[Numpy-discussion] Latest Array-Interface PEP

Stefan van der Walt stefan at sun.ac.za
Fri Jan 5 09:51:20 EST 2007


On Fri, Jan 05, 2007 at 09:38:49AM -0500, Neal Becker wrote:
>     Several extensions to Python utilize the buffer protocol to share
>     the location of a data-buffer that is really an N-dimensional
>     array.  However, there is no standard way to exchange the
>     additional N-dimensional array information so that the data-buffer
>     is interpreted correctly.
>  
> I am questioning if this is the best concept.  It says that the data-buffer
> will carry the information about it's interpretation as an N-dimensional
> array.
> 
> I'm thinking that a buffer is just an interface to memory, and that the
> interpretation as an array of n-dimensions, for example, is best left to
> the application.  I might want to at one time view the data as
> n-dimensional, but at another time as 1-dimensional, for example.

You can always choose to ignore that information if you don't need it.
On the other hand, if you *do* need it, how would you otherwise
interpret an N-dimensional array, given only a buffer?

Cheers
Stéfan



More information about the NumPy-Discussion mailing list