https://github.com/python/cpython/commit/9a1f30fd2839c2959827f13c2b8baec88ae9cc7f
commit: 9a1f30fd2839c2959827f13c2b8baec88ae9cc7f
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: encukou <[email protected]>
date: 2026-05-14T19:09:15+02:00
summary:

[3.14] Link to existing rules in compound_stmts.rst (GH-149811) (GH-149837)

Link to existing rules in compound_stmts.rst (GH-149811)

In gh-138418, `!` was added to links to rules that don't exist in
the docs, in order to silence broken link warnings.
However, productionlist doesn't parse the `!`, which ends up in
the rendered documentation. (It's possible that gh-127835 broke
the `!` support.)

Replace the names with ones that appear in docs:

- `star_named_expression` in the grammar corresponds to
  `flexible_expression` in the docs
- `star_named_expressions` in the grammar corresponds to
  `flexible_expression_list` in the docs
- `named_expression` in the grammar corresponds to
  `assignment_expression` in the docs

Having two sets of names isn't great of course. Consolidating them
is tracked in (subissues of) gh-127833.
(cherry picked from commit c37529293d1e05081cb4e8668162c76583b88007)

Co-authored-by: Petr Viktorin <[email protected]>

files:
M Doc/reference/compound_stmts.rst

diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index ed73f6c068c4ab..0193383a06d1a7 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -618,8 +618,8 @@ The match statement is used for pattern matching.  Syntax:
 
 .. productionlist:: python-grammar
    match_stmt: 'match' `subject_expr` ":" NEWLINE INDENT `case_block`+ DEDENT
-   subject_expr: `!star_named_expression` "," `!star_named_expressions`?
-               : | `!named_expression`
+   subject_expr: `flexible_expression` "," [`flexible_expression_list` [',']]
+               : | `assignment_expression`
    case_block: 'case' `patterns` [`guard`] ":" `!block`
 
 .. note::
@@ -709,7 +709,7 @@ Guards
 .. index:: ! guard
 
 .. productionlist:: python-grammar
-   guard: "if" `!named_expression`
+   guard: "if" `assignment_expression`
 
 A ``guard`` (which is part of the ``case``) must succeed for code inside
 the ``case`` block to execute.  It takes the form: :keyword:`if` followed by an

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to