[Python-ideas] Fix that broken callable builtin

Joao S. O. Bueno jsbueno at python.org.br
Sat Apr 18 14:42:41 CEST 2015


On 17 April 2015 at 18:39, Guido van Rossum <guido at python.org> wrote:
> I think you've found an unintended and undocumented backdoor. I admit I
> don't understand how this works in CPython. Overloaded operators like
> __add__ or __call__ should be methods in the class, and we don't look for
> them in the instance. But somehow defining them with @property works (I
> guess because @property is in the class).
>
> What's different for __call__ is that callable() exists. And this is
> probably why I exorcised it Python 3.0 -- but apparently it's back. :-(

And for much that I've searched I've never found out the reasoning on
that exorcism.
Since you are at it, could you describe it?

I am glad it is back - I think it is definitely needed - even if just
works in a sort
of naive way.


More information about the Python-ideas mailing list