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

Alexander Belopolsky ndarray at mac.com
Sat Mar 22 22:51:06 EDT 2014


On Sat, Mar 22, 2014 at 10:35 PM, Sturla Molden <sturla.molden at gmail.com
>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 left
> associative as well.
>

This is a very strong argument, IMO.  If we want to win over the hearts
of np.matrix users, we should not tell them - BTW - treat @ as you do **,
not *.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140322/43358983/attachment.html>


More information about the NumPy-Discussion mailing list