[PyPy-issue] [issue708] Discrepancy in dict subclass __getitem__ calls between CPython 2.7 and PyPy 1.5

Carl Friedrich Bolz pypy-dev-issue at codespeak.net
Fri May 6 11:07:52 CEST 2011


Carl Friedrich Bolz <cfbolz at gmx.de> added the comment:

This is one of the documented differences between PyPy and CPython:

http://pypy.readthedocs.org/en/latest/cpython_differences.html#subclasses-of-built-in-types

PyPy will call __getitem__ in more situations than CPython, because it would be
much harder to follow CPython's slightly random behavior.

To fix your use case, why do you need to make the Cache its own dict? Just so
that the Cache objects also have all dict methods? If yes, you might want to use
DictMixin:

http://docs.python.org/library/userdict.html#UserDict.DictMixin

----------
release: ??? -> 1.5
status: unread -> wontfix

_______________________________________________________
PyPy development tracker <pypy-dev-issue at codespeak.net>
<https://codespeak.net/issue/pypy-dev/issue708>
_______________________________________________________



More information about the Pypy-issue mailing list