[issue9930] Incorrect semantics of __radd__ method for builtin types

Georg Brandl report at bugs.python.org
Thu Sep 23 21:12:06 CEST 2010

Georg Brandl <georg at python.org> added the comment:

This is indeed weird.  PyNumber_Add ends up calling compare_add with the float as its first argument, which is impossible to do from Python.  And the wrap_binaryfunc_r check for subtypes means that compare.__radd__ claims it doesn't support floats either.  So from Python, it's impossible to add floats and complex numbers via __special__ methods :)

Maybe Mark wants to shed some light?

nosy: +georg.brandl

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list