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.

classification
Title: fix hashing
Type: Stage:
Components: None Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: fdrake Nosy List: fdrake, gvanrossum, tim.peters, tmick
Priority: normal Keywords: patch

Created on 2000-06-06 02:40 by tmick, last changed 2022-04-10 16:02 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
None tmick, 2000-06-06 02:40 None
Messages (8)
msg32676 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-06 02:40
 
msg32677 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2000-06-29 19:20
Applied verbatim; patch to PC/winreg.c applied to PC/_winreg.c due to name change.
msg32678 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2000-06-22 16:23
just testing the SF patch manager
msg32679 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2000-06-26 15:03
Tim, please review!  Then assign to Trent if it's OK to commit.
msg32680 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2000-06-27 05:50
Changed to Accepted, assigned back to Trent for commit.

Looks good, Trent!  My only gripe is about the hash function for complex numbers (because it's symmetric), but that problem existed before and you haven't made it any worse.  Ship it (I'll improve the complex hash later).
msg32681 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2000-06-27 06:03
Changed to Accepted, assigned back to Trent for commit.

Looks good, Trent!  My only gripe is about the hash function for complex numbers (because it's symmetric), but that problem existed before and you haven't made it any worse.  Ship it (I'll improve the complex hash later).
msg32682 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-06 02:43
This patch addresses two main issues:
(1) There exist some non-fatal errors in some of the hash algorithms. For
    exmaple, in float_hash and complex_hash a certain part of the value is
	not included in the hash calculation. See Tim's, Guido's, and my
	discussion of this on python-dev in May under the title
	          "fix float_hash and complex_hash for 64-bit *nix"
			  
(2) The hash algorithms that use pointers (e.g. func_hash, code_hash) are
    universally not correct on Win64 (they assume that sizeof(long) ==
	sizeof(void*))

As well, this patch significantly cleans up the hash code. It adds the two
function _Py_HashDouble and _PyHash_VoidPtr that the various hashing routine
are changed to use.

These help maintain the hash function invariant:
	(a==b) => (hash(a)==hash(b)))
I have added Lib/test/test_hash.py and Lib/test/output/test_hash to test this
for some cases.

msg32683 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-06 23:37
I confirm that, to the best of my knowledge and belief, this
contribution is free of any claims of third parties under
copyright, patent or other rights or interests ("claims").  To
the extent that I have any such claims, I hereby grant to CNRI a
nonexclusive, irrevocable, royalty-free, worldwide license to
reproduce, distribute, perform and/or display publicly, prepare
derivative versions, and otherwise use this contribution as part
of the Python software and its related documentation, or any
derivative versions thereof, at no cost to CNRI or its licensed
users, and to authorize others to do so.

I acknowledge that CNRI may, at its sole discretion, decide
whether or not to incorporate this contribution in the Python
software and its related documentation.  I further grant CNRI
permission to use my name and other identifying information
provided to CNRI by me for use in connection with the Python
software and its related documentation.
History
Date User Action Args
2022-04-10 16:02:00adminsetgithub: 32427
2000-06-06 02:40:44tmickcreate