GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Associativity of matmul unclear from grammar for m_expr · Issue #117961 · python/cpython

Associativity of matmul unclear from grammar for m_expr  #117961

New issue
Copy link
New issue
Copy link
Open
Open
Associativity of matmul unclear from grammar for m_expr #117961
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc direasy

Description

@arnoegw
arnoegw
opened on Apr 17, 2024
Issue body actions

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

  • gh-117961: Fix grammar documentation for @ operator associativity #138847
  • gh-117961: Fix grammar production for multiplicative operators #145636
  • gh-117961: Fix matmul grammar in expression docs #149281

Activity

  1. arnoegw
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Apr 17, 2024
  2. StanFromIreland
    added
    easy
    on Sep 4, 2025
  3. github-project-automation
    added this to docs issueson Sep 4, 2025
  4. github-project-automation
    moved this to Todo in docs issueson Sep 4, 2025
  5. k4ran909 commented on Jun 29, 2026

    @k4ran909
    k4ran909
    on Jun 29, 2026 · Hidden as low-quality
    show commentMore actions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc direasy

    Projects

    • docs issues
      Status
      Todo
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.