Skip to content

Doc: Fix matrix multiplication grammar rule in expressions reference - #162723

Closed
anisayakmitra-in wants to merge 1 commit into
python:mainfrom
anisayakmitra-in:fix-m-expr-matrix-mult-grammar
Closed

anisayakmitra-in wants to merge 1 commit into
python:mainfrom
anisayakmitra-in:fix-m-expr-matrix-mult-grammar

Conversation

@anisayakmitra-in

Copy link
Copy Markdown

Description

In Doc/reference/expressions.rst under the python-grammar production list for m_expr, the @ matrix multiplication operator listed m_expr on the right-hand side (m_expr "@" m_expr) instead of u_expr.

This change updates the rule to m_expr "@" u_expr, matching all other multiplicative operators (*, /, //, %) and aligning with the actual PEG grammar specification in Grammar/python.gram (term '@' factor where term corresponds to m_expr and factor corresponds to u_expr).

  • Issue: None (documentation improvement)

📚 Documentation-only change (no NEWS entry required).

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>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #36205684 | 📁 Comparing 84039ca against main (5dbe2ac)

  🔍 Preview build  

1 file changed
± reference/expressions.html

@StanFromIreland

Copy link
Copy Markdown
Member

Duplicate of #149281.

@anisayakmitra-in
anisayakmitra-in deleted the fix-m-expr-matrix-mult-grammar branch November 29, 2026 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants