Hrvoje Niksic wrote: >> However, the second version does not work. I think I understand >> why. That's because "a" inside f1 is not a function (but an object). > > An object that defines __call__ is perfectly usable as a function. > Your problem is that it doesn't know how to convert itself to a > method, so that f1.a() knows how to pass f1 as another_self to > add.__call__. To do that, add needs to be a bit smarter:
A! Now it works, thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list