Skip to content

Commit

Permalink
self to cls
Browse files Browse the repository at this point in the history
  • Loading branch information
loboda4450 committed Dec 17, 2023
1 parent e6c1a0a commit 287824a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions inpost/static/statuses.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@


class Meta(EnumMeta): # temporary handler for unexpected keys in enums
def __getitem__(self, item):
def __getitem__(cls, item):
try:
return super().__getitem__(item) if item is not None else None
except KeyError:
return self.UNKNOWN
return cls.UNKNOWN

def __getattribute__(self, item):
def __getattribute__(cls, item):
try:
return super().__getattribute__(item) if item is not None else None
except KeyError:
return self.UNKNOWN
return cls.UNKNOWN

# def get_all(cls):
# return [getattr(cls, name) for name in cls.__members__]
Expand Down

0 comments on commit 287824a

Please sign in to comment.