[issue17816] Weak*Dictionary KeyErrors during callbacks

Nils Bruin report at bugs.python.org
Tue Apr 23 03:50:11 CEST 2013


Nils Bruin added the comment:

I think the difference in behaviour between Py3 and Py2 is coming from:

http://hg.python.org/cpython/file/a26df2d03989/Objects/dictobject.c#l1275

which first clears all values before removing any keys. For a WeakValueDictionary that means all the weakrefs are neutralized before the can be activated. I don't quite understand how Py3 manages to avoid problems for a WeakKeyDictionary, but apparently it does.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17816>
_______________________________________


More information about the Python-bugs-list mailing list