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

Chris Perkins chrisperkins99 at gmail.com
Fri Jan 7 06:20:09 CST 2005

On Fri, 7 Jan 2005 10:01:37 +0530, Prabhu Ramachandran
<prabhu_r at users.sf.net> wrote:
> I noticed that numarray does not support this interface.  My feature
> request is that numarray arrays also support this buffer interface (if
> possible).

I second this request.

Note that numarray arrays have a member called "_data" that does
support the buffer interface.  I have been using code like this for a
while (pseudocode):

def asBuffer(a):
    if a is a numarray array:
        return a._data
    elif a is a Numeric array:
        return a
    else: ... do something else

But it would be nice if the numarray array supported the buffer
interface directly. I have no idea how hard or easy this would be to

Chris Perkins

More information about the Numpy-discussion mailing list