[Numpy-discussion] order keyword
Charles R Harris
charlesr.harris at gmail.com
Tue Sep 5 13:37:19 CDT 2006
On 9/5/06, Travis Oliphant <oliphant.travis at ieee.org> wrote:
> 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.
Yeah, I noticed that the PyArray_OrderConverter just replaces None by "A"
and is common to all the methods but the default is set in the calling code.
> 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.
Ok, I will add a comment to tofile that the data is written out in "C"
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion