Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-04-06 Thread Nathaniel Smith
On Tue, Apr 1, 2014 at 4:13 PM, Charles R Harris wrote: > > > > On Mon, Mar 24, 2014 at 6:33 PM, Nathaniel Smith wrote: >> >> On Mon, Mar 24, 2014 at 11:58 PM, Charles R Harris >> wrote: >> > On Mon, Mar 24, 2014 at 5:56 PM, Nathaniel Smith wrote: >> >> >> >> On Sat, Mar 22, 2014 at 6:13 PM, Na

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-04-01 Thread Charles R Harris
On Mon, Mar 24, 2014 at 6:33 PM, Nathaniel Smith wrote: > On Mon, Mar 24, 2014 at 11:58 PM, Charles R Harris > wrote: > > On Mon, Mar 24, 2014 at 5:56 PM, Nathaniel Smith wrote: > >> > >> On Sat, Mar 22, 2014 at 6:13 PM, Nathaniel Smith wrote: > >> > After 88 emails we don't have a conclusion

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-26 Thread josef . pktd
On Mon, Mar 24, 2014 at 8:33 PM, Nathaniel Smith wrote: > On Mon, Mar 24, 2014 at 11:58 PM, Charles R Harris > wrote: >> On Mon, Mar 24, 2014 at 5:56 PM, Nathaniel Smith wrote: >>> >>> On Sat, Mar 22, 2014 at 6:13 PM, Nathaniel Smith wrote: >>> > After 88 emails we don't have a conclusion in th

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-24 Thread Nathaniel Smith
On Mon, Mar 24, 2014 at 11:58 PM, Charles R Harris wrote: > On Mon, Mar 24, 2014 at 5:56 PM, Nathaniel Smith wrote: >> >> On Sat, Mar 22, 2014 at 6:13 PM, Nathaniel Smith wrote: >> > After 88 emails we don't have a conclusion in the other thread (see >> > [1] for background). But we have to come

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-24 Thread Charles R Harris
On Mon, Mar 24, 2014 at 5:56 PM, Nathaniel Smith wrote: > On Sat, Mar 22, 2014 at 6:13 PM, Nathaniel Smith wrote: > > After 88 emails we don't have a conclusion in the other thread (see > > [1] for background). But we have to come to some conclusion or another > > if we want @ to exist :-). So I

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-24 Thread Nathaniel Smith
On Sat, Mar 22, 2014 at 6:13 PM, Nathaniel Smith wrote: > After 88 emails we don't have a conclusion in the other thread (see > [1] for background). But we have to come to some conclusion or another > if we want @ to exist :-). So I'll summarize where the discussion > stands and let's see if we ca

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-24 Thread Joseph Martinot-Lagarde
Le 22/03/2014 19:13, Nathaniel Smith a écrit : > Hi all, > > After 88 emails we don't have a conclusion in the other thread (see > [1] for background). But we have to come to some conclusion or another > if we want @ to exist :-). So I'll summarize where the discussion > stands and let's see if we

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-24 Thread Pierre Haessig
Hi, Le 22/03/2014 19:13, Nathaniel Smith a écrit : > After 88 emails we don't have a conclusion in the other thread (see > [1] for background). But we have to come to some conclusion or another > if we want @ to exist :-). So I'll summarize where the discussion > stands and let's see if we can fin

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-23 Thread Christophe Bal
The left associativity should be the less disturbing choice. Using parenthesis to force right associativity will be not too painful. How many matrices in long product are involved concretely in Numpy projects ? On the other hand, Nathaniel proposed a new way to evaluate associative operators, and

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-23 Thread Ralf Gommers
On Sun, Mar 23, 2014 at 3:14 AM, Nathaniel Smith wrote: > On Sat, Mar 22, 2014 at 7:59 PM, Robert Kern > wrote: > > On Sat, Mar 22, 2014 at 6:13 PM, Nathaniel Smith wrote: > >> Hi all, > >> > >> After 88 emails we don't have a conclusion in the other thread (see > >> [1] for background). But we

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-22 Thread Alexander Belopolsky
On Sat, Mar 22, 2014 at 10:35 PM, Sturla Molden wrote: > On the other hand, this > > vec.T @ Mat @ Mat > > would not need parentheses for optimisation when the associativity is left. > > Nor does it require .T if vec is 1d. > > By the way, the * operator for np.matrix and Matlab matrices are

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-22 Thread Sturla Molden
Nathaniel Smith wrote: > - There might be some speed argument, if people often write things > like "Mat @ Mat @ vec"? But no-one has found any evidence that people > actually do write such things often. With left associativity, this would be an algorithmic optimization: Mat @ (Mat @ vec)

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-22 Thread Nathaniel Smith
On Sat, Mar 22, 2014 at 7:59 PM, Robert Kern wrote: > On Sat, Mar 22, 2014 at 6:13 PM, Nathaniel Smith wrote: >> Hi all, >> >> After 88 emails we don't have a conclusion in the other thread (see >> [1] for background). But we have to come to some conclusion or another >> if we want @ to exist :-)

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-22 Thread Sturla Molden
Charles R Harris wrote: > Well, I this point I think we might as well go with left associativity. > Most of the operator uses looked to involve a single `@`, where it doesn't > matter, and the others were short where adding a couple of parenthesis > wouldn't mess things up too much. That is wha

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-22 Thread Charles R Harris
On Sat, Mar 22, 2014 at 12:13 PM, Nathaniel Smith wrote: > Hi all, > > After 88 emails we don't have a conclusion in the other thread (see > [1] for background). But we have to come to some conclusion or another > if we want @ to exist :-). So I'll summarize where the discussion > stands and let'

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-22 Thread Andrea Gavana
Hi, On 22 March 2014 19:13, Nathaniel Smith wrote: > Hi all, > > After 88 emails we don't have a conclusion in the other thread (see > [1] for background). But we have to come to some conclusion or another > if we want @ to exist :-). So I'll summarize where the discussion > stands and let's see

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-22 Thread Robert Kern
On Sat, Mar 22, 2014 at 6:13 PM, Nathaniel Smith wrote: > Hi all, > > After 88 emails we don't have a conclusion in the other thread (see > [1] for background). But we have to come to some conclusion or another > if we want @ to exist :-). So I'll summarize where the discussion > stands and let's

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-22 Thread Éric Depagne
Hi Nate, Many thanks first for the efforts you put in this. I'm not a computer scientist, but will give my opinion as physicist. As such, when I see A x B x C (A, B and C being matrices), I tend to read it from right to left : Ax (BxC). But if the size of the matrices do not match like this, t

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-22 Thread Eric Firing
On 2014/03/22 8:13 AM, Nathaniel Smith wrote: > Hi all, > > After 88 emails we don't have a conclusion in the other thread (see > [1] for background). But we have to come to some conclusion or another > if we want @ to exist:-). So I'll summarize where the discussion > stands and let's see if we ca

Re: [Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-22 Thread Alexander Belopolsky
On Sat, Mar 22, 2014 at 2:13 PM, Nathaniel Smith wrote: > If you think of some other arguments in favor of left-associativity, > then please share! > I argued on python-ideas [1] that given the display properties of python lists and numpy arrays, vec @ Mat is more natural than Mat @ vec. The la

[Numpy-discussion] Resolving the associativity/precedence debate for @

2014-03-22 Thread Nathaniel Smith
Hi all, After 88 emails we don't have a conclusion in the other thread (see [1] for background). But we have to come to some conclusion or another if we want @ to exist :-). So I'll summarize where the discussion stands and let's see if we can find some way to resolve this. The fundamental questi