Author: Armin Rigo <[email protected]> Branch: Changeset: r70531:5a5b5c41db43 Date: 2014-04-10 11:01 +0200 http://bitbucket.org/pypy/pypy/changeset/5a5b5c41db43/
Log: Document this difference diff --git a/pypy/doc/cpython_differences.rst b/pypy/doc/cpython_differences.rst --- a/pypy/doc/cpython_differences.rst +++ b/pypy/doc/cpython_differences.rst @@ -315,6 +315,15 @@ implementation detail that shows up because of internal C-level slots that PyPy does not have. +* on CPython, ``[].__add__`` is a ``method-wrapper``, and + ``list.__add__`` is a ``slot wrapper``. On PyPy these are normal + bound or unbound method objects. This can occasionally confuse some + tools that inspect built-in types. For example, the standard + library ``inspect`` module has a function ``ismethod()`` that returns + True on unbound method objects but False on slot wrappers. On PyPy we + can't tell the difference, and so ``ismethod(list.__add__)`` has to + return True. + * the ``__dict__`` attribute of new-style classes returns a normal dict, as opposed to a dict proxy like in CPython. Mutating the dict will change the type and vice versa. For builtin types, a dictionary will be returned that _______________________________________________ pypy-commit mailing list [email protected] https://mail.python.org/mailman/listinfo/pypy-commit
