Skip to content

Commit 082875d

Browse files
authored
bpo-33878: Doc: Fix missing case by simplifying. (pythonGH-7762)
The documentation was not covering multiple targets enclosed by parenthesis nor multiple targets enclosed by brackets, adding them all would be heavy, an else cover them all and is lighter to read.
1 parent 5f2df88 commit 082875d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Doc/reference/simple_stmts.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,10 @@ given with the definition of the object types (see section :ref:`types`).
121121
Assignment of an object to a target list, optionally enclosed in parentheses or
122122
square brackets, is recursively defined as follows.
123123

124-
* If the target list is empty: The object must also be an empty iterable.
124+
* If the target list is a single target with no trailing comma,
125+
optionally in parentheses, the object is assigned to that target.
125126

126-
* If the target list is a single target in parentheses: The object is assigned
127-
to that target.
128-
129-
* If the target list is a comma-separated list of targets, or a single target
130-
in square brackets: The object must be an iterable with the same number of
127+
* Else: The object must be an iterable with the same number of
131128
items as there are targets in the target list, and the items are assigned,
132129
from left to right, to the corresponding targets.
133130

0 commit comments

Comments
 (0)