[Numpy-discussion] [help needed] associativity and precedence of '@'

Alexander Belopolsky ndarray at mac.com
Sat Mar 15 15:01:48 EDT 2014


On Sat, Mar 15, 2014 at 2:25 PM, Alexander Belopolsky <ndarray at mac.com>wrote:

> On Fri, Mar 14, 2014 at 11:41 PM, Nathaniel Smith <njs at pobox.com> wrote:
>
>> Here's the main blocker for adding a matrix multiply operator '@' to
>> Python: we need to decide what we think its precedence and associativity
>> should be.
>
>
> I am not ready to form my own opinion, but I hope the following will help
> shaping the discussion.


One more question that I think should be answered by the PEP and may
influence the associativity decision is what happens if in an A @ B @ C
expression, each operand has its own type that defines __matmul__ and
__rmatmul__?  For example, A can be an ndarray, B a sympy expression and C
a pyoperator.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140315/af985ff3/attachment.html>


More information about the NumPy-Discussion mailing list