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.0013422293
Marked as misclassified No
Message-id <494CFEEF.8000203@gmail.com>
In-reply-to <494CA9A6.7070108@gmx.net>
Content
Hagen Fürstenau wrote:
> Hagen Fürstenau <hfuerstenau@gmx.net> 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.
History
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