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 josh.r
Recipients andrei.avk, brandtbucher, conchylicultor, josh.r
Date 2021-06-24.03:09:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1624504197.17.0.371701241145.issue44140@roundup.psfhosted.org>
In-reply-to
Content
Andrei: If designed appropriately, a weakref callback attached to the actual object would delete the associated ID from the dictionary when the object was being deleted to avoid that problem. That's basically how WeakKeyDictionary works already; it doesn't store the object itself (if it did, that strong reference could never be deleted), it just stores a weak reference for it that ensures that when the real object is deleted, a callback removes the weak reference from the WeakKeyDictionary; this just adds another layer to that work.

I don't think this would make sense as a mere argument to WeakKeyDictionary; the implementation would differ significantly, and probably deserves a separate class.
History
Date User Action Args
2021-06-24 03:09:57josh.rsetrecipients: + josh.r, brandtbucher, conchylicultor, andrei.avk
2021-06-24 03:09:57josh.rsetmessageid: <1624504197.17.0.371701241145.issue44140@roundup.psfhosted.org>
2021-06-24 03:09:57josh.rlinkissue44140 messages
2021-06-24 03:09:56josh.rcreate