Message157684
@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. |
|
Date |
User |
Action |
Args |
2012-04-06 20:14:41 | Jim.Jewett | set | recipients:
+ Jim.Jewett, jcea, skrah, Jimbofbx, Ramchandra Apte, serhiy.storchaka |
2012-04-06 20:14:41 | Jim.Jewett | set | messageid: <1333743281.1.0.12833431308.issue14478@psf.upfronthosting.co.za> |
2012-04-06 20:14:40 | Jim.Jewett | link | issue14478 messages |
2012-04-06 20:14:40 | Jim.Jewett | create | |
|