[Numpy-discussion] Array Protocol change for Python 2.6 (original) (raw)
Tim Hochberg tim.hochberg at cox.net
Fri Jun 9 17:08:32 EDT 2006
- Previous message (by thread): [Numpy-discussion] Array Protocol change for Python 2.6
- Next message (by thread): [Numpy-discussion] Array Protocol change for Python 2.6
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Travis Oliphant wrote:
Tim Hochberg wrote:
I was going to say that it may help to think of arrayinterface 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. arrayinterface->shape and strides point to the raw shape and strides for the array. That looks like it's a problem. Isn't:
ai = a.arrayinterface 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 were three things mixed together in my post:
The current implementation of array_struct looks buggy. Should I go ahead and file a bug report so that this behaviour doesn't get blindly copied over from array_struct to whatever the final dohickey is called or is that going to be totally rewritten in any case.
Whether array_struct or array_interface or whatever it gets called returns something that's kind of like a view (has it's own copies of shape and strides mainly) versus an alias for the original array (somehow tries to track the original arrays shape and strides) is a semantic difference, not an implementation details. I suspect that no one really cares that much about this and we'll end up doing what's easiest to get right; I'm pretty certain that is view semantics. It may be helpful to pronounce on that now, since it's possible the semantics might influence the name chosen, but I don't think it's critical.
The implementation details I provided were, uh, implentation details.
-tim
There is no such arrayinterface attribute at this point.
-Travis
Numpy-discussion mailing list Numpy-discussion at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion
- Previous message (by thread): [Numpy-discussion] Array Protocol change for Python 2.6
- Next message (by thread): [Numpy-discussion] Array Protocol change for Python 2.6
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]