Message188249
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. |
|
Date |
User |
Action |
Args |
2013-05-02 00:35:53 | Nils.Bruin | set | recipients:
+ Nils.Bruin, vbraun |
2013-05-02 00:35:53 | Nils.Bruin | set | messageid: <1367454953.8.0.3369937733.issue17816@psf.upfronthosting.co.za> |
2013-05-02 00:35:53 | Nils.Bruin | link | issue17816 messages |
2013-05-02 00:35:53 | Nils.Bruin | create | |
|