How can I “steal” or copy a method from one class onto another class?
Example code:
class A(object):
def foo(self):
print "blah"
class B(object):
foo = A.foo
B().foo()
Expected output:
"blah"
Instead:
TypeError: unbound method foo() must be called with A instance as
first argument (got nothing instead)
Use
__func__:Quoting the docs: