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 Jim.Jewett
Recipients Jim.Jewett, Jimbofbx, Ramchandra Apte, jcea, serhiy.storchaka, skrah
Date 2012-04-06.20:14:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1333743281.1.0.12833431308.issue14478@psf.upfronthosting.co.za>
In-reply-to
Content
@Jimbofbx:  You are correct that a value has to be reserved to indicate that the hash hasn't been (or can't be) computed, but python uses -1 instead of zero.

An integer can't return itself because a hash is an unboxed integer; that said, there is a fast path for small enough integers.  You can see the actual code at
http://hg.python.org/cpython/file/388016438a50/Objects/longobject.c#l2581 

Since it is too late for 3.2, I suggest closing this and opening a separate 3.3 issue if the existing improvements are not sufficient.
History
Date User Action Args
2012-04-06 20:14:41Jim.Jewettsetrecipients: + Jim.Jewett, jcea, skrah, Jimbofbx, Ramchandra Apte, serhiy.storchaka
2012-04-06 20:14:41Jim.Jewettsetmessageid: <1333743281.1.0.12833431308.issue14478@psf.upfronthosting.co.za>
2012-04-06 20:14:40Jim.Jewettlinkissue14478 messages
2012-04-06 20:14:40Jim.Jewettcreate