[Numpy-discussion] PEP updated
oliphant at ee.byu.edu
Sat Feb 19 19:52:20 EST 2005
I've updated the PEP to conform to what I think is the best hybrid
solution propsed and that is to implement a tree of PythonTypes in C
whose leaves are (to the Python user) new rank-0 arrays. This is
more work to implement (but I don't think a great deal of work see
below), and I think it will lead to the best results under our current
Internally, the PyArray_Type will still deal with rank-0 arrays (in fact
the new Python scalars will be converted to them internally rather than
special-case a bunch of code).
I don't think we should try to solve the general number-hierchy in
Python at this time. We will implement the array-number hierarchy
only. If this leads to others getting interested in the general
problem, then that may come, but now we have to focus on our objective
of getting the arrayobject accepted into Python.
Note that these new rank-0 Python scalars will be simple, have the same
methods and attributes as Python arrays (likely-implemented once in the
GenericArrType by converting the object to a rank-0 array).
Also, they will inherit (multiple-inheritance is possible in C) from the
appropriate Python Type where an exact-match is available.
More information about the NumPy-Discussion