[Python-ideas] An identity dict

spir ☣ denis.spir at gmail.com
Sun May 30 13:28:02 CEST 2010


On Sun, 30 May 2010 03:27:53 +0000 (UTC)
Benjamin Peterson <benjamin at python.org> wrote:

> This dict is very useful for keep track of objects that should not be compared
> by normal comparison methods. For example, I would use an identitydict to hold
> weak references that would otherwise fallback to their referant object's hash.

The main point is certainly that the limitation of "hashability" disappears... Everything can be used as key, if actually the ref is hashed instead of the value.

Denis
________________________________

vit esse estrany ☣

spir.wikidot.com



More information about the Python-ideas mailing list