[Numpy-discussion] Thoughts on an ndarray super-class

Sasha ndarray at mac.com
Wed Feb 22 23:21:03 CST 2006


On 2/23/06, Travis Oliphant <oliphant.travis at ieee.org> wrote:
> ...
> I have been thinking, however, of replacing it with a super-class that
> does not define the dimensions or strides.
>
Having a simple 1-d array in numpy would be great.  In an ideal world
I would rather see a 1-d array implemented in C together with a set of
array operations that is rich enough to allow trivial implementation
of ndarray in pure python.

When you say "does not define the dimensions or strides" do you refer
to python interface or to C struct?  I thought python did not allow to
add data members to object structs in subclasses.


> In other words, the default array would be just a block of memory.  The
> standard array would inherit from the default and add dimension and
> strides pointers.
>
If python lets you do it, how will that block of memory know its size?




More information about the Numpy-discussion mailing list