[Tutor] hash value input
denis.spir at free.fr
Sat Jan 30 10:56:46 CET 2010
On Fri, 29 Jan 2010 08:23:37 -0800
Emile van Sebille <emile at fenx.com> wrote:
> > So, how does python do this?
> Start here...
Great, thank you!
From the above pointed page:
For ordinary integers, the hash value is simply the integer itself (unless it’s -1).
value = self
if value == -1:
value == -2
I'm surprised of this, for this should create as many indexes (in the underlying array actually holding the values) as there are integer keys. With possibly huge holes in the array. Actually, there will certainly be a predefined number of indexes N, and the integers be further "modulo-ed" N. Or what?
I would love to know how to sensibly chose the number of indexes. Pointers welcome (my searches did not bring any clues on the topic).
la vita e estrany
More information about the Tutor