2 ms·
You should either remove `self` or bind it differently: foo = Foo() def hello(): print("hello, %s" % (foo,)) foo.hello = hello `foo` is an instanc
by d0mine 15y ago
You should either remove `self` or bind it differently:
foo = Foo()
def hello():
print("hello, %s" % (foo,))
foo.hello = hello
`foo` is an instance therefore `self == foo` already.
def hello(self):
print("hello, %s" % (self,))
foo.hello = types.MethodType(hello, foo)