[Numpy-discussion] Is this a bug?

Travis E. Oliphant oliphant at enthought.com
Wed May 28 20:52:15 EDT 2008


Anne Archibald wrote:
> 2008/5/27 Robert Kern <robert.kern at gmail.com>:
>
>   
>> Can we make it so that dtype('c') is preserved instead of displaying
>> '|S1'? It does not behave the same as dtype('|S1') although it
>> compares equal to it.
>>     
>
> It seems alarming to me that they should compare equal but behave
> differently. Is it possible to change more than just the way it
> prints?
>   
comparison on dtype objects is about memory layout equivalency.  
Characters and length-1 strings are equivalent from a memory-layout 
perspective.

-Travis




More information about the NumPy-Discussion mailing list