[Numpy-discussion] Response to PEP suggestions

Peter Verveer verveer at embl-heidelberg.de
Fri Feb 18 00:59:29 CST 2005


> In that vein, I am proposing making X.flat an array iterator  and 
> allowing array iterators to be indexed and set as if they were 1-d 
> arrays with the underlying array being changed.  This is actually an 
> easy change with the current code base.  Will it break any code?
> There maybe some X.flats that need to be changed to ravel.  But it 
> seems like a really good idea.

That iterator would only work on the Python level I suppose, that would 
be effectively indistinguishable from an 1D array. But how would that 
work when passed to a function implemented in C? The function needs to 
know somehow that non-contiguous arrays need to be treated as 1D. That 
means having to code for such a special case (not a good idea), or you 
are back to making a copy.





More information about the Numpy-discussion mailing list