[Numpy-discussion] order flag again

Fernando Perez Fernando.Perez at colorado.edu
Mon Mar 27 12:57:05 CST 2006


On 01:46 PM Tim Hochberg wrote:

> As I've mentioned before, I'd like to sweep all of the operations that may
> return a view or a copy into a few asXXXarray functions so that these 
> potentially problematic operations are localized and easily identifiable.

+1 on the idea that:

asXXXarray: functions which take their input and return always an array, but 
trying to avoid copies if at all possible.  This means that code calling such 
functions should treat their returned values strictly as /inputs/, never 
modifying them in place.  These functions are provided by numpy strictly for 
performance reasons.

Or something like that.  I like being able to tell to users that this kind of 
problem is solved by a unified familiy of functions in the API, with a clear 
naming convention.  There is a need for them, but they are also a bit 
dangerous, so they should be clearly labeled.  Painting them all in the same 
bright red helps indicate their 'sharp blade' nature.

Cheers,

f




More information about the Numpy-discussion mailing list