[Python-ideas] User-defined literals

Guido van Rossum guido at python.org
Thu Jun 4 21:49:06 CEST 2015


On Thu, Jun 4, 2015 at 12:14 PM, Andrew Barnert via Python-ideas <
python-ideas at python.org> wrote:

> But this isn't actually true. That BINARY_ADD opcode looks up the addition
> method at runtime and calls it. And that means that if you monkeypatch
> complex.__radd__, your method will get called.
>

Wrong. You can't moneypatch complex.__radd__. That's a feature of the
language.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150604/3592e195/attachment.html>


More information about the Python-ideas mailing list