[Python-checkins] python/dist/src/Lib/test test_tuple.py,1.3,1.4
tim_one at users.sourceforge.net
tim_one at users.sourceforge.net
Tue Jun 1 14:58:23 EDT 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28241
Modified Files:
test_tuple.py
Log Message:
test_hash(): The test here is different enough from the one in the bug
report that the stats for expected # of collisions are a little higher.
Updated comments accordingly.
Index: test_tuple.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_tuple.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** test_tuple.py 1 Jun 2004 06:36:24 -0000 1.3
--- test_tuple.py 1 Jun 2004 18:58:04 -0000 1.4
***************
*** 50,56 ****
# should be distinct from element hashes: hash(x)!=hash((x,))
# This test exercises those cases.
! # For a pure random hash and N=50, the expected number of collisions
! # is 7.3. Here we allow twice that number.
! # Any worse and the hash function is sorely suspect.
N=50
--- 50,60 ----
# should be distinct from element hashes: hash(x)!=hash((x,))
# This test exercises those cases.
! # For a pure random hash and N=50, the expected number of occupied
! # buckets when tossing 252,600 balls into 2**32 buckets
! # is 252,592.6, or about 7.4 expected collisions. The
! # standard deviation is 2.73. On a box with 64-bit hash
! # codes, no collisions are expected. Here we accept no
! # more than 15 collisions. Any worse and the hash function
! # is sorely suspect.
N=50
More information about the Python-checkins
mailing list