PEP 572: Fix a small issue found by Steve Dower, and clarify priority around commas.

This commit is contained in:
Guido van Rossum 2018-07-08 21:21:30 -07:00
parent 6a681307a6
commit 79480d5cde
1 changed files with 7 additions and 2 deletions

View File

@ -329,15 +329,20 @@ found in assignment statements:
- Multiple targets are not directly supported:: - Multiple targets are not directly supported::
x = y = z = 0 # Equivalent: (x := (y := (z := 0))) x = y = z = 0 # Equivalent: (z := (y := (x := 0)))
- Single assignment targets more complex than a single ``NAME`` are - Single assignment targets other than than a single ``NAME`` are
not supported:: not supported::
# No equivalent # No equivalent
a[i] = x a[i] = x
self.rest = [] self.rest = []
- Priority around commas is different::
x = 1, 2 # Sets x to (1, 2)
(x := 1, 2) # Sets x to 1
- Iterable packing and unpacking (both regular or extended forms) are - Iterable packing and unpacking (both regular or extended forms) are
not supported:: not supported::