[Numpy-discussion] Native byteorder representation

Travis Oliphant oliphant at ee.byu.edu
Fri Feb 2 12:22:12 EST 2007


Francesc Altet wrote:

>Hi,
>
>We have been bitten by a small glitch related with the representation of 
>native byteorders. Here is an example exposing the problem:
>
>  
>
>>>>numpy.dtype('<i4').byteorder
>>>>        
>>>>
>'='
>  
>
>>>>numpy.dtype('>i4').newbyteorder('little').byteorder
>>>>        
>>>>
>'<'
>
>  
>
This is somewhat inconsistent.  But, I'm not sure it's worth changing.  

In the second case, you request a "little" byteorder data-type.  Keeping 
this as '<' seems O.K.

One could instead ask why the first example did not report a byte-order 
of "<" when that's what was explicitly asked for.

-Travis




More information about the NumPy-Discussion mailing list