hashkey/digest for a complex object

kj no.email at please.post
Thu Oct 7 06:53:04 EDT 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:

>http://google.com/codesearch/p?hl=de#-2BKs-LW4I0/trunk/python/src/Objects/tupleobject.c&q=python%20tuplehash&sa=N&cd=1&ct=rc

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).

~kj



More information about the Python-list mailing list