[Numpy-discussion] prerelease proposal for matrix behavior

Bill Baxter wbaxter at gmail.com
Fri Apr 25 21:42:11 EDT 2008


On Sat, Apr 26, 2008 at 10:27 AM, Charles R Harris
<charlesr.harris at gmail.com> wrote:
>
>
> On Fri, Apr 25, 2008 at 6:38 PM, Alan G Isaac <aisaac at american.edu> wrote:
> > OK, we are not converging in time for the release.
> > So can we at least raise a TypeError on scalar
> > indexing of matrices, so that we remain free to choose
> > the ultimate behavior?
> >
> > Those who have spoke up have generally favored
> > letting x[0] return a 1d array, if I count correctly.
> > And I think that is the right "provisional" behavior.
> > (As well as ultimate.) But many have not spoken up.
> >
>
> That would be the most compatible with arrays, but won't it break a lot of
> code?

Any change to the behavior of x[0] for matrices is going to break a lot of code.
It actually seems like a good idea to me to make it an error for a
while -- or maybe some kind of settable option -- to help people
figure out where they need to fix their code.  Better to get an error
immediately.

--bb



More information about the NumPy-Discussion mailing list