Python functions and their __call__ attribute

I recommend you read special method lookup for new-style classes (especially the last paragraph).

For new-style classes, implicit invocations of special methods are
only guaranteed to work correctly if defined on an object’s type, not
in the object’s instance dictionary.

Leave a Comment