hashing mutable instances

Thomas Heller theller at python.net
Thu Oct 30 13:58:02 EST 2003


Alex Martelli <aleax at aleax.it> writes:

[about object.__hash__]
> Bernhard Herzog wrote:
>    ...
>> Good question. I didn't know that that was the default implementation of
>> __hash__. It's not documented AFAICT, but it does seem to be the case. I
>
> I don't know why the official docs don't mention this fact -- I do
> mention it in "Python in a Nutshell", of course (p. 132).
>
>> wonder why, even though it's useful.
>
> The reason this is done is because it's useful.

Well, Guido seems to disagree.  Per his request, when I complained about
the default __hash__() method he asked me to enter a bug about it:
http://www.python.org/sf/660098.  But it doesn't seem easy at all to fix
this...

Thomas




More information about the Python-list mailing list