Please note that your A.foo does not use the name of the function, but the function itself.
class A: def bar(self): print 'Bar' def apply(self, func): func()
In python, a.foo() same as A.foo(a) , where a is of type a . Therefore, your copyApply method accepts the unbound bar method as an argument, while foo accepts the associated method.
source share