You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test_set.TestFrozenSet.test_hash_effectiveness verifies some properties of frozenset.__hash__. One of the steps involves calculating the hash of powerset(range(18)). This part of the test runs so slowly that the parameters had to be reduced for it to finish.
Expected
The test runs as written in an acceptable time frame.
Actual
The test has been modified to powerset(range(13)).
Code in question
def powerset(s):
for i in range(len(s)+1):
yield from map(frozenset, itertools.combinations(s, i))
for n in range(18):
t = 2 ** n
mask = t - 1
for nums in (range, zf_range):
u = len({h & mask for h in map(hash, powerset(nums(n)))})
self.assertGreater(4*u, t)
I suspect the problem is in generating the powerset, not calculating the hash.
The text was updated successfully, but these errors were encountered:
Summary
test_set.TestFrozenSet.test_hash_effectiveness
verifies some properties offrozenset.__hash__
. One of the steps involves calculating the hash ofpowerset(range(18))
. This part of the test runs so slowly that the parameters had to be reduced for it to finish.Expected
The test runs as written in an acceptable time frame.
Actual
The test has been modified to
powerset(range(13))
.Code in question
I suspect the problem is in generating the powerset, not calculating the hash.
The text was updated successfully, but these errors were encountered: