mirror of
https://github.com/python/cpython.git
synced 2025-10-07 15:42:02 +00:00
bpo-45716: Improve the error message when using True/False/None as keywords in a call (GH-29413)
This commit is contained in:
parent
32f55d1a5d
commit
e2d65630f3
4 changed files with 1553 additions and 1437 deletions
|
@ -524,9 +524,15 @@ SyntaxError: expression cannot contain assignment, perhaps you meant "=="?
|
|||
>>> f((x)=2)
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: expression cannot contain assignment, perhaps you meant "=="?
|
||||
>>> f(True=2)
|
||||
>>> f(True=1)
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: expression cannot contain assignment, perhaps you meant "=="?
|
||||
SyntaxError: cannot assign to True
|
||||
>>> f(False=1)
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: cannot assign to False
|
||||
>>> f(None=1)
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: cannot assign to None
|
||||
>>> f(__debug__=1)
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: cannot assign to __debug__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue