mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
bpo-43121: Fix incorrect SyntaxError message for missing comma (GH-24436)
This commit is contained in:
parent
bfe544d2f2
commit
d4e6ed7e5f
4 changed files with 29 additions and 8 deletions
|
@ -246,9 +246,25 @@ SyntaxError: did you forget parentheses around the comprehension target?
|
|||
Traceback (most recent call last):
|
||||
SyntaxError: did you forget parentheses around the comprehension target?
|
||||
|
||||
>>> {x,y: None for x,y in range(100)}
|
||||
# Missing commas in literals collections should not
|
||||
# produce special error messages regarding missing
|
||||
# parentheses
|
||||
|
||||
>>> [1, 2 3]
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: did you forget parentheses around the comprehension target?
|
||||
SyntaxError: invalid syntax
|
||||
|
||||
>>> {1, 2 3}
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: invalid syntax
|
||||
|
||||
>>> {1:2, 2:5 3:12}
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: invalid syntax
|
||||
|
||||
>>> (1, 2 3)
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: invalid syntax
|
||||
|
||||
From compiler_complex_args():
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue