Currently, any attribute call adds the instance as a first argument for the receiver, accordingly, the following doesn't work.
class A:
def __init__(self, f):
self.f = f
def g(self):
return self.f()
def f():
pass
x = A(f)
because the call self.f() in method g is considered a method call, so it as the instance self as an argument, whereas function f doesn't expect any arguments.
Currently, any attribute call adds the instance as a first argument for the receiver, accordingly, the following doesn't work.
because the call
self.f()
in methodg
is considered a method call, so it as the instanceself
as an argument, whereas functionf
doesn't expect any arguments.