Nick Coghlan <ncogh...@gmail.com> added the comment: Hagen Fürstenau wrote: > Hagen Fürstenau <hfuerste...@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. _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4701> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com