[pypy-issue] Issue #2146: WeakKeyDictionary has some bugs (pypy/pypy)

kmod issues-reply at bitbucket.org
Fri Sep 25 22:29:05 CEST 2015


New issue 2146: WeakKeyDictionary has some bugs
https://bitbucket.org/pypy/pypy/issues/2146/weakkeydictionary-has-some-bugs

kmod:

It looks like PyPy uses the CPython implementation of WeakKeyDictionary and WeakValueDictionary, but that implementation relies on quick destruction.  It looks like PyPy (2.6.0) has a fix for the WeakValueDictionary case, but WeakKeyDictionary has the same issue (the callback can be postponed to the point that it removes the wrong entry from the dict).

Here's Pyston's solution (and corresponding test), which I think should work for PyPy but I haven't tested it:
https://github.com/dropbox/pyston/commit/28dc1184d7b2178df4e9bc00ae2e1eaffea575f9




More information about the pypy-issue mailing list