A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-April/063326.html below:

[Python-Dev] Saving the hash value of tuples

[Python-Dev] Saving the hash value of tuples [Python-Dev] Saving the hash value of tuplesRaymond Hettinger python at rcn.com
Mon Apr 3 05:23:58 CEST 2006
>> I've found out that the hash value of tuples isn't saved after it's
>> calculated. With strings it's different: the hash value of a string is
>> calculated only on the first call to hash(string), and saved in the
>> structure for future use. Saving the value makes dict lookup of tuples
>> an operation with an amortized cost of O(1).
>>  [...] 
>> I will be happy to send a patch, if someone shows interest.
> 
> Regardless of whether anyone shows interest, please submit a patch!  Then
> post the URL back here.  That way if someone gets interested in the
> future, your code is still available.

FWIW, I think that is not a good idea.  Guido shot it down for good reason.
Once a patch is loaded, the question will continually resurface every few
months and waste everyone's time re-hashing the issue.  We have bigger
dragons to slay.


Raymond
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4