Message157684
| 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. |
|