mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Issue #23275: Allow () = iterable assignment syntax
Documentation updates by Martin Panter.
This commit is contained in:
parent
93d22ecc7c
commit
094c9c921c
7 changed files with 41 additions and 41 deletions
|
@ -35,14 +35,6 @@ SyntaxError: invalid syntax
|
|||
Traceback (most recent call last):
|
||||
SyntaxError: can't assign to keyword
|
||||
|
||||
It's a syntax error to assign to the empty tuple. Why isn't it an
|
||||
error to assign to the empty list? It will always raise some error at
|
||||
runtime.
|
||||
|
||||
>>> () = 1
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: can't assign to ()
|
||||
|
||||
>>> f() = 1
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: can't assign to function call
|
||||
|
@ -491,10 +483,6 @@ Traceback (most recent call last):
|
|||
...
|
||||
SyntaxError: keyword argument repeated
|
||||
|
||||
>>> del ()
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: can't delete ()
|
||||
|
||||
>>> {1, 2, 3} = 42
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: can't assign to literal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue