Message78108
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. |
|
Date |
User |
Action |
Args |
2008-12-20 14:19:41 | ncoghlan | set | recipients:
+ ncoghlan, rhettinger, amaury.forgeotdarc, eric.smith, gpolo, hagen |
2008-12-20 14:19:40 | ncoghlan | link | issue4701 messages |
2008-12-20 14:19:39 | ncoghlan | create | |
|