From 84039ca57f6011a8d0b053511ed8b5cbd8047e8c Mon Sep 17 00:00:00 2001 From: ANISAYAK MITRA <266799942+anisayakmitra-in@users.noreply.github.com> Date: Fri, 27 Nov 2026 13:39:45 +0530 Subject: [PATCH] Doc: Fix matrix multiplication grammar rule in expressions reference In the python-grammar production list for m_expr, the '@' matrix multiplication operator previously listed 'm_expr' on the right-hand side instead of 'u_expr'. This fixes the rule to use 'u_expr', matching the actual PEG grammar in Grammar/python.gram ('term @ factor') and ensuring unambiguous left-associative multiplicative syntax. Signed-off-by: ANISAYAK MITRA <266799942+anisayakmitra-in@users.noreply.github.com> --- Doc/reference/expressions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 97be69cc0225b9..cd40a489dfa426 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -1844,7 +1844,7 @@ from the power operator, there are only two levels, one for multiplicative operators and one for additive operators: .. productionlist:: python-grammar - m_expr: `u_expr` | `m_expr` "*" `u_expr` | `m_expr` "@" `m_expr` | + m_expr: `u_expr` | `m_expr` "*" `u_expr` | `m_expr` "@" `u_expr` | : `m_expr` "//" `u_expr` | `m_expr` "/" `u_expr` | : `m_expr` "%" `u_expr` a_expr: `m_expr` | `a_expr` "+" `m_expr` | `a_expr` "-" `m_expr`