[Numpy-discussion] Inplace reshape

Christopher Barker Chris.Barker at noaa.gov
Mon Apr 23 14:29:42 EDT 2007


Charles R Harris wrote:
>     Here's a better doc string that explains "This will be a new view
>     object if possible; otherwise, it will return a copy."

Does this exist somewhere, or are you contributing it now?

> I think that it should raise an error, or warn, if it needs to make a 
> copy,

I totally agree, and that behavior matches the current ('1.0.2') docstring.

> but that isn't the  tradition.

so sad -- could this be deprecated. I know we had a pretty length 
discussion about this issue in another context. In general, it's a bad 
idea for methods to sometimes return copies and sometimes views -- it's 
begging for subtle bugs!

oh well, either the code or the docstring should change, in any case.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov



More information about the NumPy-Discussion mailing list