Skip to content

Commit

Permalink
style: Use 'cls' (not 'self') in class methods
Browse files Browse the repository at this point in the history
There is no `self` when there is no instance. Only the static class
`cls` means anything in such context. As the linter says:

    N804 first argument of a classmethod should be named 'cls'
  • Loading branch information
adrienverge committed Aug 28, 2023
1 parent 9b9676f commit cbe2b13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions localstripe/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ def __init__(self):
schedule_webhook(Event('balance.available', self))

@classmethod
def _api_retrieve(self):
obj = store.get(self.object)
def _api_retrieve(cls):
obj = store.get(cls.object)
if obj is None:
return self()
return cls()
return obj

def _export(self, expand=None):
Expand Down

0 comments on commit cbe2b13

Please sign in to comment.