[Numpy-discussion] Array Protocol change for Python 2.6
Travis Oliphant
oliphant at ee.byu.edu
Fri Jun 9 16:05:50 EDT 2006
Tim Hochberg wrote:
>I was going to say that it may help to think of array_interface as
>returning a *view*, since that seems to be the semantics that could
>probably be implemented safely without too much trouble. However, it
>looks like that's not what happens. array_interface->shape and strides
>point to the raw shape and strides for the array. That looks like it's a
>problem. Isn't:
>
> >>> ai = a.__array_interface__
> >>> a.shape = newshape
>
>going to result in ai having a stale pointers to shape and strides that
>no longer exist?
>
This is an implementation detail. I'm still trying to gather some kind
of consensus on what to actually do here. There is no such
__array_interface__ attribute at this point.
-Travis
More information about the NumPy-Discussion
mailing list