Skip to content

Commit a405d75

Browse files
committed
Simplify
1 parent ae1d67d commit a405d75

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Doc/reference/expressions.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ A list display is a possibly empty series of expressions enclosed in square
253253
brackets:
254254

255255
.. productionlist:: python-grammar
256-
list_display: "[" [`starred_list` | `comprehension`] "]"
256+
list_display: "[" [`expression_list` | `comprehension`] "]"
257257

258258
A list display yields a new list object, the contents being specified by either
259259
a list of expressions or a comprehension. When a comma-separated list of
@@ -278,7 +278,7 @@ A set display is denoted by curly braces and distinguishable from dictionary
278278
displays by the lack of colons separating keys and values:
279279

280280
.. productionlist:: python-grammar
281-
set_display: "{" (`starred_list` | `comprehension`) "}"
281+
set_display: "{" (`expression_list` | `comprehension`) "}"
282282

283283
A set display yields a new mutable set object, the contents being specified by
284284
either a sequence of expressions or a comprehension. When a comma-separated
@@ -455,8 +455,8 @@ generator. That generator then controls the execution of the generator
455455
function. The execution starts when one of the generator's methods is called.
456456
At that time, the execution proceeds to the first yield expression, where it is
457457
suspended again, returning the value of
458-
:token:`~python-grammar:flexible_expression_list` to the generator's caller,
459-
or ``None`` if :token:`~python-grammar:flexible_expression_list` is omitted.
458+
:token:`~python-grammar:expression_list` to the generator's caller,
459+
or ``None`` if :token:`~python-grammar:expression_list` is omitted.
460460
By suspended, we mean that all local state is
461461
retained, including the current bindings of local variables, the instruction
462462
pointer, the internal evaluation stack, and the state of any exception handling.
@@ -545,7 +545,7 @@ is already executing raises a :exc:`ValueError` exception.
545545
:meth:`~generator.__next__` method, the current yield expression always
546546
evaluates to :const:`None`. The execution then continues to the next yield
547547
expression, where the generator is suspended again, and the value of the
548-
:token:`~python-grammar:flexible_expression_list` is returned to
548+
:token:`~python-grammar:expression_list` is returned to
549549
:meth:`__next__`'s caller. If the generator exits without yielding another
550550
value, a :exc:`StopIteration` exception is raised.
551551

@@ -664,7 +664,7 @@ how a generator object would be used in a :keyword:`for` statement.
664664
Calling one of the asynchronous generator's methods returns an :term:`awaitable`
665665
object, and the execution starts when this object is awaited on. At that time,
666666
the execution proceeds to the first yield expression, where it is suspended
667-
again, returning the value of :token:`~python-grammar:flexible_expression_list`
667+
again, returning the value of :token:`~python-grammar:expression_list`
668668
to the awaiting coroutine. As with a generator, suspension means that all local
669669
state is retained, including the current bindings of local variables, the
670670
instruction pointer, the internal evaluation stack, and the state of any
@@ -728,7 +728,7 @@ which are used to control the execution of a generator function.
728728
asynchronous generator function is resumed with an :meth:`~agen.__anext__`
729729
method, the current yield expression always evaluates to :const:`None` in the
730730
returned awaitable, which when run will continue to the next yield
731-
expression. The value of the :token:`~python-grammar:flexible_expression_list`
731+
expression. The value of the :token:`~python-grammar:expression_list`
732732
of the yield expression is the value of the :exc:`StopIteration` exception
733733
raised by the completing coroutine. If the asynchronous generator exits
734734
without yielding another value, the awaitable instead raises a
@@ -861,7 +861,7 @@ will generally select an element from the container. The subscription of a
861861
:ref:`GenericAlias <types-genericalias>` object.
862862

863863
.. productionlist:: python-grammar
864-
subscription: `primary` "[" `flexible_expression_list` "]"
864+
subscription: `primary` "[" `expression_list` "]"
865865

866866
When an object is subscripted, the interpreter will evaluate the primary and
867867
the expression list.
@@ -1879,11 +1879,11 @@ Expression lists
18791879

18801880
.. productionlist:: python-grammar
18811881

1882-
starred_item: "*" `or_expr`
1883-
flexible_expression: `expression` | `assignment_expression` | `starred_item`
1884-
flexible_expression_list: `flexible_expression` ("," `flexible_expression`)* [","]
1885-
yield_list: `expression` ["," `flexible_expression_list`]
1886-
| `starred_item` "," [`flexible_expression_list`]
1882+
expression_list: `flexible_expression` ("," `flexible_expression`)* [","]
1883+
yield_list: `expression` ["," `expression_list`]
1884+
| `starred_expression` "," [`expression_list`]
1885+
flexible_expression: `assignment_expression` | `starred_expression`
1886+
starred_expression: "*" `or_expr`
18871887

18881888
.. index:: pair: object; tuple
18891889

0 commit comments

Comments
 (0)