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 malthe
Recipients malthe
Date 2022-03-04.23:25:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
When a key that is equal to an existing key (but not the same object identity) is used to set a new value, the key itself is not replaced.

This manifests perhaps most clearly in `weakref.WeakKeyDictionary` where keys can mysteriously disappear.

Consider two equal keys, k1 and k2:

d = WeakKeyDictionary()
d[k1] = 1
d[k2] = 2
del k1

We would expect the dictionary to have a single entry k2 => 2. But in fact it is empty now.
Date User Action Args
2022-03-04 23:25:53malthesetrecipients: + malthe
2022-03-04 23:25:53malthesetmessageid: <>
2022-03-04 23:25:53malthelinkissue46925 messages
2022-03-04 23:25:53malthecreate