On Sat, Nov 8, 2014 at 3:31 PM, Gregory Ewing <greg.ew...@canterbury.ac.nz> wrote: > (BTW, I'm actually surprised that this technique makes c callable. > There must be more going on that just "look up __call__ in the class > object", because evaluating C.__call__ just returns the descriptor > and doesn't invoking the descriptor mechanism.)
But of course it doesn't just lookup C.__call__, because it has to bind the method to the instance before calling it, which means invoking the descriptor protocol. The actual lookup is more like: type(a).__dict__['__call__'].__get__(a, type(a)) -- https://mail.python.org/mailman/listinfo/python-list