(such as a string, tuple or list) or other iterable object:
.. productionlist:: python-grammar
- for_stmt: "for" `target_list` "in" `starred_list` ":" `suite`
+ for_stmt: "for" `target_list` "in" `starred_expression_list` ":" `suite`
: ["else" ":" `suite`]
-The ``starred_list`` expression is evaluated once; it should yield an
-:term:`iterable` object. An :term:`iterator` is created for that iterable.
-The first item provided
-by the iterator is then assigned to the target list using the standard
-rules for assignments (see :ref:`assignment`), and the suite is executed. This
-repeats for each item provided by the iterator. When the iterator is exhausted,
+The :token:`~python-grammar:starred_expression_list` expression is evaluated
+once; it should yield an :term:`iterable` object. An :term:`iterator` is
+created for that iterable. The first item provided by the iterator is then
+assigned to the target list using the standard rules for assignments
+(see :ref:`assignment`), and the suite is executed. This repeats for each
+item provided by the iterator. When the iterator is exhausted,
the suite in the :keyword:`!else` clause,
if present, is executed, and the loop terminates.
single: , (comma); expression list
.. productionlist:: python-grammar
- starred_expression: ["*"] `or_expr`
+ starred_expression: "*" `or_expr` | `expression`
flexible_expression: `assignment_expression` | `starred_expression`
flexible_expression_list: `flexible_expression` ("," `flexible_expression`)* [","]
starred_expression_list: `starred_expression` ("," `starred_expression`)* [","]