[Numpy-discussion] Numarray feature request: supporting the buffer interface

Prabhu Ramachandran prabhu_r at users.sf.net
Thu Jan 6 20:32:03 CST 2005


Hi Numarray developers,

Numeric arrays support the buffer interface by providing an
array_as_buffer structure in the type object definition by doing this:

     (PyBufferProcs *)&array_as_buffer,    /*tp_as_buffer*/

and adding this to the tp_flags:

     Py_TPFLAGS_HAVE_GETCHARBUFFER),      /*tp_flags*/

This is very handy when one needs to pass void arrays into C/C++ code
and is used to pass data from Numeric to C or C++ libraries very
efficiently.  In particular, this is very useful when passing Numeric
array data to VTK.

I noticed that numarray does not support this interface.  My feature
request is that numarray arrays also support this buffer interface (if
possible).

Thanks!

cheers,
prabhu

p.s. I'm not on this list so please cc me in on any messages.  Thanks!




More information about the Numpy-discussion mailing list