From: Simon B. <si...@ar...> - 2006-05-28 07:50:06
|
Is there a reason why dtype's are unhashable ? (ouch) On another point, is there a canonical list of dtype's ? I'd like to test the dtype of an array, and I always end up with something like this: if array.dtype == numpy.dtype('l'): ... When I would prefer to write something like: if array.dtype == numpy.Int32: ... (i can never remember these char codes !) Alternatively, should dtype's __cmp__ promote the other arg to a dtype before the compare ? I guess not, since that would break a lot of code: eg. dtype(None) is legal. Simon. -- Simon Burton, B.Sc. Licensed PO Box 8066 ANU Canberra 2601 Australia Ph. 61 02 6249 6940 http://arrowtheory.com |