|
|
|
|
|
by majormajor
5031 days ago
|
|
You only have to list self in the declaration, you don't have to pass the instance to itself. Borrowing masklinn's example: >>> class Foo(object):
... def __init__(self):
... self.n = 42
... def bar(self):
... return self.n
...
>>> f = Foo()
>>> f.bar()
42
|
|