[Numpy-discussion] The array interface published
oliphant at ee.byu.edu
Sun Apr 3 01:41:09 CST 2005
Michiel Jan Laurens de Hoon wrote:
> There are two questions that I have about the array interface:
> 1) To what degree will the new array interface look different to users
> of the existing Numerical Python? If I were to install the new array
> interface on the computer of a current Numerical Python user and I
> didn't tell them, would they notice a difference?
Nothing will look different. For now there is nothing to "install" so
the array interface is just something to expect from other objects.
The only thing that would be different is in Numeric 24.0 (if a users
were to call array(<someobj>) and <someobj> supported the array
interface then Numeric could return an array (without copying data).
Older versions of Numeric won't benefit from the interface but won't be
> 2) To what degree is the new array interface compatible with Numerical
> Python for the purpose of C extension modules? Do C extension modules
> need to be modified in order to use the new array interface?
It is completely compatible. C-extensions don't need to be modified at
all to make use of the interface (of course they should be re-compiled
if using Numeric 24.0). Only two things will be modified in Numeric
24.0. 1) PyArray_FromObject and friends will be expanded so that if an
object exposes the array interface the right thing will be done to use
it's memory. 2) Attributes will be added so that Numeric arrays expose
the array interface so other objects can use their memory intelligently
More information about the Numpy-discussion