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 gdr@garethrees.org
Recipients benjamin.peterson, ereuveni, fdrake, gdr@garethrees.org, gvanrossum, pitrou
Date 2015-04-28.11:42:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1430221366.62.0.437252097586.issue24067@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation says that weakref.Proxy objects are not hashable because "this avoids a number of problems related to their fundamentally mutable nature, and prevent their use as dictionary keys".

Hashable objects must be immutable, otherwise the hash might change, invalidating the invariants that make dictionaries work, but Proxy objects are fundamentally mutable: when there are no more strong references to the proxied object, the object gets destroyed and the Proxy object now refers to None. If the Proxy object were hashable then its hash would change at this point.
History
Date User Action Args
2015-04-28 11:42:46gdr@garethrees.orgsetrecipients: + gdr@garethrees.org, gvanrossum, fdrake, pitrou, benjamin.peterson, ereuveni
2015-04-28 11:42:46gdr@garethrees.orgsetmessageid: <1430221366.62.0.437252097586.issue24067@psf.upfronthosting.co.za>
2015-04-28 11:42:46gdr@garethrees.orglinkissue24067 messages
2015-04-28 11:42:45gdr@garethrees.orgcreate