Why Methods Bind Automatically
class Foo:
def bar(self):
return "bar"
f = Foo()
print(f.bar)
This prints something like <bound method Foo.bar of <...>> rather than the plain function object stored in Foo.__dict__['bar']. What makes that happen?
Sign in to answer questions and track your progress
Sign In