Dag Sverre Seljebotn wrote:
> Robert Bradshaw wrote:
>> to do a lookup in a Python hashtable you need to
>>
>> (1) Wrap the float in a Python object
>> (2) call __hash__ on that new object
> 
> I hope that isn't what actually happens :-) Floating point and hashes 
> don't seem like a good idea.

That certainly depends on the hash function. A float value is not more than
a bunch of bits after all, just like an int or string. It even has the
advantage of being exactly a multiple of 4 bytes large, so a hash function
can actually deploy extremely efficient CPU operations.

Stefan

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to