diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-06-01 18:58:04 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-06-01 18:58:04 (GMT) |
commit | 1f4bcf9edd88600ce99cfbeef16bcea810a5826f (patch) | |
tree | 450623fd55ddb8efa5986c24ac6ba43a2011cc8b | |
parent | 7897ff0d9a026195d0aa54c55117958d29633dcb (diff) | |
download | cpython-1f4bcf9edd88600ce99cfbeef16bcea810a5826f.zip cpython-1f4bcf9edd88600ce99cfbeef16bcea810a5826f.tar.gz cpython-1f4bcf9edd88600ce99cfbeef16bcea810a5826f.tar.bz2 |
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.
-rw-r--r-- | Lib/test/test_tuple.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/test/test_tuple.py b/Lib/test/test_tuple.py index a3f40dd..33a6edd 100644 --- a/Lib/test/test_tuple.py +++ b/Lib/test/test_tuple.py @@ -49,9 +49,13 @@ class TupleTest(seq_tests.CommonTest): # should not exhibit cancellation in tuples like (x,(x,y)) # 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. + # 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 base = range(N) |