[Numpy-discussion] Thoughts on getting "something" in the Python core
Travis Oliphant
oliphant at ee.byu.edu
Thu Mar 31 15:53:01 EST 2005
To all interested in the future of arrays...
I'm still very committed to Numeric3 as I want to bring the numarray and
Numeric people together behind a single array object for scientific
computing.
But, I've been thinking about the array protocol and thinking that it
would be a good thing if this became universal. One of the ways to make
it universal is by having something that follows it in the Python core.
So, what if we proposed for the Python core not something like Numeric3
(which would still exist in scipy.base and be everybody's favorite array
:-) ), but a very minimal array object (scaled back even from Numeric)
that followed the array protocol and had some C-API associated with it.
This minimal array object would support 5 basic types ('bool',
'integer', 'float', 'complex', 'Object'). (Maybe a void type could be
defined and a void "scalar" introduced (which would be the bytes
object)). These types correspond to scalars already available in Python
and so the whole 0-dim array Python scalar arguments could be ignored.
Math could be done without ufuncs initially (people really needing speed
would use scipy.base anyway). But, more people in the Python community
would be able to use arrays and get used to them. And we would have a
reference array_protocol object so that extension writers could write to
it.
I would not try a project like this until after scipy_core is out, but
it's an interesting thing to think about. I mainly wanted feedback on
the basic concept.
An alternative would be to "add" multidimensionality to the array object
already part of Python, fix it's reallocating with an exposed buffer
problem, and add the array protocol.
-Travis
More information about the NumPy-Discussion
mailing list