Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Doc/reference/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ Parenthesized forms
A parenthesized form is an optional expression list enclosed in parentheses:

.. productionlist:: python-grammar
parenth_form: "(" [`starred_expression`] ")"
parenth_form: "(" [`flexible_expression_list`] ")"

A parenthesized expression list yields whatever that expression list yields: if
the list contains at least one comma, it yields a tuple; otherwise, it yields
Expand Down Expand Up @@ -628,7 +628,7 @@ Yield expressions
.. productionlist:: python-grammar
yield_atom: "(" `yield_expression` ")"
yield_from: "yield" "from" `expression`
yield_expression: "yield" `yield_list` | `yield_from`
yield_expression: "yield" [`yield_list` | `yield_from`]

The yield expression is used when defining a :term:`generator` function
or an :term:`asynchronous generator` function and
Expand Down
8 changes: 4 additions & 4 deletions Doc/reference/simple_stmts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ expression statements are allowed and occasionally useful. The syntax for an
expression statement is:

.. productionlist:: python-grammar
expression_stmt: `starred_expression`
expression_stmt: `starred_expression_list`

An expression statement evaluates the expression list (which may be a single
expression).
Expand Down Expand Up @@ -84,7 +84,7 @@ Assignment statements are used to (re)bind names to values and to modify
attributes or items of mutable objects:

.. productionlist:: python-grammar
assignment_stmt: (`target_list` "=")+ (`starred_expression` | `yield_expression`)
assignment_stmt: (`target_list` "=")+ (`starred_expression_list` | `yield_expression`)
target_list: `target` ("," `target`)* [","]
target: `identifier`
: | "(" [`target_list`] ")"
Expand Down Expand Up @@ -275,7 +275,7 @@ Augmented assignment is the combination, in a single statement, of a binary
operation and an assignment statement:

.. productionlist:: python-grammar
augmented_assignment_stmt: `augtarget` `augop` (`expression_list` | `yield_expression`)
augmented_assignment_stmt: `augtarget` `augop` (`starred_expression_list` | `yield_expression`)
augtarget: `identifier` | `attributeref` | `subscription`
augop: "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**="
: | ">>=" | "<<=" | "&=" | "^=" | "|="
Expand Down Expand Up @@ -324,7 +324,7 @@ statement, of a variable or attribute annotation and an optional assignment stat

.. productionlist:: python-grammar
annotated_assignment_stmt: `augtarget` ":" `expression`
: ["=" (`starred_expression` | `yield_expression`)]
: ["=" (`starred_expression_list` | `yield_expression`)]

The difference from normal :ref:`assignment` is that only a single target is allowed.

Expand Down
Loading