[issue8188] Unified hash for numeric types.

Mark Dickinson report at bugs.python.org
Sun Mar 21 12:02:50 CET 2010


Mark Dickinson <dickinsm at gmail.com> added the comment:

Updated patch:

 - put hash parameters into pyport.h, to avoid repetition;  make them
   available to Python code via a private attribute sys._hash_info.

 - use a modulus of 2**61-1 on systems where SIZEOF_LONG >= 8, and
   a modulus of 2**31 - 1 otherwise.

 - remove _invmod from fractions module.  It's faster (and easier) to
   use 3-argument pow to compute inverses modulo a prime.

 - add a few more tests.

----------
Added file: http://bugs.python.org/file16610/numeric_hash3.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8188>
_______________________________________


More information about the Python-bugs-list mailing list