This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Nils.Bruin
Recipients Nils.Bruin, vbraun
Date 2013-05-02.00:35:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1367454953.8.0.3369937733.issue17816@psf.upfronthosting.co.za>
In-reply-to
Content
One solution is to patch both WeakValueDictionary and WeakKeyDictionary with their own clear methods where we first store the strong links (to keys, resp. values) in a list, then clear the underlying dictionaries (this will now trigger the deletion of the weakrefs, so all callbacks are neutralized), and then delete the list. It does use more storage that way, but it gets rid of the ignored key errors.

This is a different problem from issue7105, which deals with the (much more complicated) scenario of avoiding dictionary reshaping due to GC when iterators are still (potentially) active.
History
Date User Action Args
2013-05-02 00:35:53Nils.Bruinsetrecipients: + Nils.Bruin, vbraun
2013-05-02 00:35:53Nils.Bruinsetmessageid: <1367454953.8.0.3369937733.issue17816@psf.upfronthosting.co.za>
2013-05-02 00:35:53Nils.Bruinlinkissue17816 messages
2013-05-02 00:35:53Nils.Bruincreate