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 ajaksu2
Recipients ajaksu2, facundobatista, mark.dickinson
Date 2007-09-12.17:09:02
SpamBayes Score 0.0018560748
Marked as misclassified No
Message-id <1189616943.2.0.312335275339.issue1772851@psf.upfronthosting.co.za>
In-reply-to
Content
IMHO this patch should be considered for  (at least) py3k, in which long
becomes the new int. As there is current interest in long/int
performance[1] this seems like a good time to raise this kind of issue.

 Mark, could you please outline the semantic changes (specially at
wraparound)? Would the hash value changes happen only in "wraparound (=
subtraction +           of 2**(bits_in_long)) by incrementing" cases?  
Would hash(-1) become -1?

Sorry to ask all that, but my C (and maths) is (are) *very* limited. I
guess an invalid hash value is the reason to have hash(-1) == hash(-2)
== -2 currently, if so the period would have to skip that, right? I
don't see the need for "y" and would chain some IFs (if x == -1 OR
abs(x) == ULONG_MAX), but those are weak guesses.


 Maybe it's worth discussing this patch  without linking its most
important change (long hash becoming periodic) to Decimal: it would have
many impacts beyond Decimal and is rather a core change (as opposed to
Lib).  Also,  a recent discussion on hashing[2] shows that sometimes the
current behavior was well planned :)

1 -  http://mail.python.org/pipermail/python-3000/2007-September/010374.html
2 - http://mail.python.org/pipermail/python-3000/2007-September/010327.html
History
Date User Action Args
2007-09-12 17:09:03ajaksu2setspambayes_score: 0.00185607 -> 0.0018560748
recipients: + ajaksu2, facundobatista, mark.dickinson
2007-09-12 17:09:03ajaksu2setspambayes_score: 0.00185607 -> 0.00185607
messageid: <1189616943.2.0.312335275339.issue1772851@psf.upfronthosting.co.za>
2007-09-12 17:09:03ajaksu2linkissue1772851 messages
2007-09-12 17:09:02ajaksu2create