[Numpy-discussion] order keyword

Travis Oliphant oliphant.travis at ieee.org
Tue Sep 5 12:02:52 CDT 2006

Charles R Harris wrote:
> I am trying to write more document strings for numpy and have a 
> question about the order keyword in tostring. The usual allowed values 
> of this keyword are "C", "F", or None, but in the tostring method 
> there is also the value "Any" which has the same effect as None. I 
> wonder if the "Any" shouldn't be removed as None seems to be the 
> preferred form in other methods. 
I don't think keeping 'Any' as a keyword here is a problem.

> Also, the default value of order in the tostring method is "C" and it 
> seems to me that the principal of least surprise requires None as the 
> default so that the order of the array being converted is the default.
I've thought this through several times.  There may be a few cases where 
'Any' is appropriate but the user will be expecting 'C' as the default 
because that was the only possibility for a long time.  It's actually 
very problematic to switch to 'Any' as the default.  You end up with 
lots of surprises as things start behaving very differently then they 
used to under Numeric once you transpose the array.


More information about the Numpy-discussion mailing list