@@ -873,9 +873,13 @@ primary is subscripted, the evaluated result of the expression list will be
873873passed to one of these methods. For more details on when ``__class_getitem__ ``
874874is called instead of ``__getitem__ ``, see :ref: `classgetitem-versus-getitem `.
875875
876- If the expression list contains at least one comma, it will evaluate to a
877- :class: `tuple ` containing the items of the expression list. Otherwise, the
878- expression list will evaluate to the value of the list's sole member.
876+ If the expression list contains at least one comma, or if any of the expressions
877+ is starred, the expression list will evaluate to a :class: `tuple ` containing the
878+ items of the expression list. Otherwise, the expression list will evaluate to
879+ the value of the list's sole member.
880+
881+ .. versionchanged :: 3.11
882+ Expressions in an expression list may be starred. See :pep: `646 ` for details.
879883
880884For built-in objects, there are two types of objects that support subscription
881885via :meth: `~object.__getitem__ `:
@@ -1874,7 +1878,7 @@ Expression lists
18741878 single: , (comma); expression list
18751879
18761880.. productionlist :: python-grammar
1877- expression_list: `expression ` ("," `expression `)* [","]
1881+ expression_list: `starred_expression ` ("," `starred_expression `)* [","]
18781882 starred_list: `starred_item ` ("," `starred_item `)* [","]
18791883 starred_expression: `expression ` | (`starred_item ` ",")* [`starred_item `]
18801884 starred_item: `assignment_expression ` | "*" `or_expr `
@@ -1898,6 +1902,9 @@ the unpacking.
18981902.. versionadded :: 3.5
18991903 Iterable unpacking in expression lists, originally proposed by :pep: `448 `.
19001904
1905+ .. versionadded :: 3.11
1906+ Any item in an expression list may be starred. See :pep: `646 `.
1907+
19011908.. index :: pair: trailing; comma
19021909
19031910A trailing comma is required only to create a one-item tuple,
0 commit comments