Documentation
6.7. Binary arithmetic operations shows the grammar rule
m_expr ::= u_expr | m_expr "*" u_expr | m_expr "@" m_expr |
m_expr "//" u_expr | m_expr "/" u_expr |
m_expr "%" u_expr
in which all operators except @ for matmul are left-associative (meaning, a*b*c parses as m_expr a*b and u_expr c ) while @ is ambiguous: Does a@b@c parse as m_expr a@b and m_expr c or as m_expr a and m_expr b@c?
According to PEP 465, @ should have the same associativity as *. Should this grammar rule should reflect that by saying m_expr "@" u_expr, that is, with the right-hand side changed from m_expr to u_expr?
Linked PRs
Documentation
6.7. Binary arithmetic operations shows the grammar rule
in which all operators except
@for matmul are left-associative (meaning,a*b*cparses as m_expra*band u_exprc) while@is ambiguous: Doesa@b@cparse as m_expra@band m_exprcor as m_expraand m_exprb@c?According to PEP 465,
@should have the same associativity as*. Should this grammar rule should reflect that by sayingm_expr "@" u_expr, that is, with the right-hand side changed fromm_exprtou_expr?Linked PRs