Stéfan van der Walt wrote:
> 2009/3/12 David Cournapeau <courn...@gmail.com>:
>   
>> Anyway, here is a first shot at it:
>>
>> http://codereview.appspot.com/26052
>>     
>
> Design question: should [('x', float), ('y', float)] and [('t',
> float), ('s', float)] hash to the same value or not?
>   

According to:

http://docs.python.org/reference/datamodel.html#object.__hash__

The only constraint is that a == b -> hash(a) == hash(b) (which is
broken currently in numpy, even for builtin dtypes). The main problem is
that I am not very clear yet on what a == b is for dtypes (the code for
PyArray_EquivTypes goes through PyObject_Compare for compound types). In
your example, both dtypes are not equal (and they do not hash the same).

cheers,

David
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to