[Numpy-discussion] Ransom Proposals

Charles R Harris charlesr.harris at gmail.com
Sun Mar 26 20:48:01 CST 2006

On 3/25/06, Fernando Perez <Fernando.Perez at colorado.edu> wrote:
> Sasha wrote:
> > On 3/25/06, Tim Hochberg <tim.hochberg at cox.net> wrote:
> >
> >>...
> >>However, if reshape does not return a view, let's say obj is a list, it
> >>will fail. And not *just* fail, it will fail silently. There are obvious
> >>ways to fix this program (set obj.shape instead of using reshape, for
> >>example), but the fewer perils I need to remember the better.
> >
> >
> > Or, you can use the reshape method instead of function.  I believe
> > numpy advocates use of methods instead of functions.  What you observe
> > is just another reason for that.  Since functions like reshape remain
> > in numpy primarily for backwards compatibility, I would be against any
> > change in semantics.
> Mmh.  I bet many people will continue to use the functional interface for
> a
> long time.  I'd vote for uniform semantics before 1.0.  Really, the whole
> 'reshape(foo) and foo.reshape() have different view/copy behavior' thing
> is
> horrible.  WAY too easy to forget/confuse.  Special cases are /almost
> never/
> special enough to warrant this kind of extra mental overhead.

Pimpf. I just stopped using reshape. If I wanted a different shape I
assigned the tuple.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20060326/220f8db8/attachment-0001.html 

More information about the Numpy-discussion mailing list