[Numpy-discussion] untenable matrix behavior in SVN

Gael Varoquaux gael.varoquaux@normalesup....
Sat Apr 26 05:09:38 CDT 2008


On Fri, Apr 25, 2008 at 01:40:29PM -0400, Alan G Isaac wrote:
> On Fri, 25 Apr 2008, Stéfan van der Walt wrote:
> > workaround would break x[0] == x[0,:] 


> But there is not universal agreement that x[0] == x[0,:] is 
> desirable.  In contrast, there *is* universal agreement that
> x[0][0]==x[0,0] is desirable.  Or so I've understood the 
> discussion.

I DON'T AGREE! Sorry for yelling, but I don't see where you get your
universality. You want to break backward incompatibility to accomodated
wrongful indexing, and break rightful indexing. 

I don't know why people are indexing matrices with A[x][y], but they
shouldn't. We have multidimensional objects, and a lot of effort has been
put in that. Indexing with one dimension only is poor amongst other
things for performance reasons. We also see that it breaks indexing
semantics and fobrid doing clever indexing. That cannot be worked around,
because by indexing with one dimension you are putting less information
into the indexing routine than by indexing with two dimension.

> Thus I do not see  x[0] != x[0,:] as breakage:
> it is desirable. 

You may think what you want. We may desagree on what is Right, but the
breaks backward compatibility, and thus is a breakage and should be given
a lot of thought.

Gaël


More information about the Numpy-discussion mailing list