Oct-05-2017, 06:29 PM
A function defined in the class is already bound to the instance. You call it just as you would any function, with parentheses.
>>> class Spam: ... def __init__(self, foo): ... self.bar = foo ... def quz(self): ... print("I'm an instance method!") ... return self.bar ... >>> thing = Spam(42) >>> thing.quz() I'm an instance method! 42