Jim Jewett <jimjjew...@gmail.com> added the comment: @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. ---------- nosy: +Jim.Jewett _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14478> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com