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 <rep...@bugs.python.org>
<http://bugs.python.org/issue17816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to