hashkey/digest for a complex object

kj no.email at please.post
Thu Oct 7 12:53:04 CEST 2010

In <m2fwwjazs2.fsf at web.de> deets at web.de (Diez B. Roggisch) writes:

>kj <no.email at please.post> writes:

>> The short version of this question is: where can I find the algorithm
>> used by the tuple class's __hash__ method?

>Surprisingly, in the source:


Thanks to you, and to all who pointed me to the place in the source
where this is.

How exactly did you search for this?  Taking a hint from the url
above, I went to Google Code Search and searched for "python tuple
hash" (minus the quotes, of course), which produced a ton of
irrelevant stuff (almost 80K hits).  Searching for "python tuple
hash lang:c" cut down the number of hits to ~8K, but still too much
to wade through.  Clearly I need a smarter search strategy (one
that does not include foreknowledge of the name of the actual
function in the C source, of course).


More information about the Python-list mailing list