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 ncoghlan
Recipients amaury.forgeotdarc, eric.smith, gpolo, hagen, ncoghlan, rhettinger
Date 2008-12-20.14:19:39
SpamBayes Score 0.00134223
Marked as misclassified No
Message-id <>
In-reply-to <>
Hagen Fürstenau wrote:
> Hagen Fürstenau <> added the comment:
>> I don't believe there is any driving reason for them not to be hashable.
> On the other hand, what is the use case for hashing objects whose
> equality is defined as object identity?

Fast membership testing in sets to track which objects you have and
haven't seen, mapping from objects to arbitrary metadata about those
objects without having to explicitly redirect through id(), that kind of
thing. Generally speaking, the idea is that objects should be hashable
if their concept of "equality" cannot change over the life time of the
object. Identity based equality meets that criteria, which is why
objects (including range/xrange) are hashable by default.
Date User Action Args
2008-12-20 14:19:41ncoghlansetrecipients: + ncoghlan, rhettinger, amaury.forgeotdarc, eric.smith, gpolo, hagen
2008-12-20 14:19:40ncoghlanlinkissue4701 messages
2008-12-20 14:19:39ncoghlancreate