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 Giacomo.Alzetta
Recipients Giacomo.Alzetta, docs@python, r.david.murray
Date 2014-06-16.19:24:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1402946688.19.0.885777148748.issue21782@psf.upfronthosting.co.za>
In-reply-to
Content
"their hash value is their id()" seems quite clearly stating that:

>>> class A: pass
... 
>>> a = A()
>>> hash(a) == id(a)

should be true, but:

>>> hash(a) == id(a)
False

(both in python2 and in python3)

The python 2 documentation for the __hash__ special method *does* state that the default implementation returns a value "derived" by id().
I believe there is an inconsistency. In the python2 glossary it should say:

"their hash value is derived from their id()"

While in python3 it shouldn't mention id() at all, since the documentation for __hash__ doesn't mention it at all.
History
Date User Action Args
2014-06-16 19:24:48Giacomo.Alzettasetrecipients: + Giacomo.Alzetta, r.david.murray, docs@python
2014-06-16 19:24:48Giacomo.Alzettasetmessageid: <1402946688.19.0.885777148748.issue21782@psf.upfronthosting.co.za>
2014-06-16 19:24:48Giacomo.Alzettalinkissue21782 messages
2014-06-16 19:24:48Giacomo.Alzettacreate