Re: [Numpy-discussion] PyBUF_SIMPLE/PyBUF_FORMAT: casts to unsigned bytes

2011-09-02 Thread Stefan Krah
Stefan Krah wrote: > Dag Sverre Seljebotn wrote: > > Under 2), would it make sense to also export the contents of a > > Fortran-contiguous buffer as a raw byte stream? I was just the other week > > writing code to serialize an array in Fortran order to a binary stream. > > Probably, since it wor

Re: [Numpy-discussion] PyBUF_SIMPLE/PyBUF_FORMAT: casts to unsigned bytes

2011-09-01 Thread Stefan Krah
Dag Sverre Seljebotn wrote: > Under 2), would it make sense to also export the contents of a > Fortran-contiguous buffer as a raw byte stream? I was just the other week > writing code to serialize an array in Fortran order to a binary stream. Probably, since it works now and people might have got

Re: [Numpy-discussion] PyBUF_SIMPLE/PyBUF_FORMAT: casts to unsigned bytes

2011-08-24 Thread Dag Sverre Seljebotn
(sorry for the top-post, no way around it) Under 2), would it make sense to also export the contents of a Fortran-contiguous buffer as a raw byte stream? I was just the other week writing code to serialize an array in Fortran order to a binary stream. OTOH I could easily serialize its transpose

[Numpy-discussion] PyBUF_SIMPLE/PyBUF_FORMAT: casts to unsigned bytes

2011-08-23 Thread Stefan Krah
Hello, PEP-3118 presumably intended that a PyBUF_SIMPLE request should cast the original buffer's data type to 'B' (unsigned bytes). Here is a one-dimensional example that currently occurs in Lib/test/test_multiprocessing: >>> import array, io >>> a = array.array('i', [1,2,3,4,5]) >>> m = memoryv