@@ -178,7 +178,7 @@ called "displays", each of them in two flavors:
178
178
Common syntax elements for comprehensions are:
179
179
180
180
.. productionlist ::
181
- comprehension: `expression ` `comp_for `
181
+ comprehension: `assignment_expression ` `comp_for `
182
182
comp_for: ["async"] "for" `target_list ` "in" `or_test ` [`comp_iter `]
183
183
comp_iter: `comp_for ` | `comp_if `
184
184
comp_if: "if" `expression_nocond ` [`comp_iter `]
@@ -911,7 +911,8 @@ series of :term:`arguments <argument>`:
911
911
: ["," `keywords_arguments `]
912
912
: | `starred_and_keywords ` ["," `keywords_arguments `]
913
913
: | `keywords_arguments `
914
- positional_arguments: ["*"] `expression ` ("," ["*"] `expression `)*
914
+ positional_arguments: positional_item ("," positional_item)*
915
+ positional_item: `assignment_expression ` | "*" `expression `
915
916
starred_and_keywords: ("*" `expression ` | `keyword_item `)
916
917
: ("," "*" `expression ` | "," `keyword_item `)*
917
918
keywords_arguments: (`keyword_item ` | "**" `expression `)
@@ -1642,6 +1643,17 @@ returns a boolean value regardless of the type of its argument
1642
1643
(for example, ``not 'foo' `` produces ``False `` rather than ``'' ``.)
1643
1644
1644
1645
1646
+ Assignment expressions
1647
+ ======================
1648
+
1649
+ .. productionlist ::
1650
+ assignment_expression: [`identifier ` ":="] `expression `
1651
+
1652
+ .. TODO: BPO-39868
1653
+
1654
+ See :pep: `572 ` for more details about assignment expressions.
1655
+
1656
+
1645
1657
.. _if_expr :
1646
1658
1647
1659
Conditional expressions
@@ -1711,7 +1723,7 @@ Expression lists
1711
1723
expression_list: `expression ` ("," `expression `)* [","]
1712
1724
starred_list: `starred_item ` ("," `starred_item `)* [","]
1713
1725
starred_expression: `expression ` | (`starred_item ` ",")* [`starred_item `]
1714
- starred_item: `expression ` | "*" `or_expr `
1726
+ starred_item: `assignment_expression ` | "*" `or_expr `
1715
1727
1716
1728
.. index :: object: tuple
1717
1729
0 commit comments