[Numpy-discussion] Native byteorder representation

Francesc Altet faltet at carabos.com
Fri Feb 2 07:57:53 EST 2007


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
'<'

[the example was run on a little endian machine]

We thought that native byteorder were represented always by a '=', and this is 
true when you create the type from scratch. But, if you create a dtype with a 
different byteorder and then switch to a native one (in this case, 'little') 
the representation of the byteorder changes to '<' instead of '='.

We can live with this, but IMO it would be better if the final representation 
of native byteorders could always be made to read '='.

Thanks,

-- 
>0,0<   Francesc Altet     http://www.carabos.com/
V   V   Cárabos Coop. V.   Enjoy Data
 "-"



More information about the NumPy-Discussion mailing list