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.

Author jimjjewett
Recipients
Date 2007-02-02.20:20:15
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The whole point of a hash is that if it doesn't match, you can skip an expensive comparison.  How big to make the hash is a tradeoff between how much you'll waste calculating and storing it vs how often it will save a "real" comparison.

The comment means that, as an implementation detail, popitem assumes it can store a pointer there instead, so hashes need to be at least as big as a pointer.  

Going to the larger of the two sizes will certainly solve your problem; it just wastes some space, and maybe some time calculating the hash.  

If you want to get that space back, just make sure the truncation is correct and consistent.  I *suspect* your problem is that when there is a collision, either 

(1)  It is comparing a truncated value to an untruncated value, or
(2)  The perturbation to find the next slot is going wrong, because of when the truncation happens.
History
Date User Action Args
2007-08-23 14:51:34adminlinkissue1646068 messages
2007-08-23 14:51:34admincreate