Python - function as class attribute becomes a bound method
问题 I noticed that if I define a class attribute equal to a function when I create an instance of that class the attribute becomes a bound method. Can someone explain me the reason of this behaviour? In [9]: def func(): ...: pass ...: In [10]: class A(object): ....: f = func ....: In [11]: a = A() In [12]: a.f Out[12]: <bound method A.func of <__main__.A object at 0x104add190>> In [13]: a.f() --------------------------------------------------------------------------- TypeError Traceback (most