[pypy-issue] [issue944] Magic method exceptions

Armin Rigo tracker at bugs.pypy.org
Tue Nov 29 15:28:35 CET 2011

Armin Rigo <armin.rigo at gmail.com> added the comment:

No, Python is completely inconsistent.  For example:

>>> (2).__add__(None)
>>> [].__add__(None)
TypeError: ...

The internal reason is that lists implement the C slot "sq_concat", whereas ints
implement the C slot "nb_add".  PyPy has no way to express that difference,
because it doesn't have internal slots that are different from the Python
methods.  It's one of the few remaining incompatibility, and has been decreed

Added documentation to cpython_differences.html.

nosy: +arigo
status: unread -> wontfix

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list