-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Python 3.10.5
New SyntaxError ^ pointer is misleading in following example compared to older python versions.
d = {
"foo":"foo",
"bar":lambda b:{"bar":testfn(von="1"b=b)},
}
Results in error message on 3.10.5:
File "test.py", line 3
"bar":lambda b:{"bar":testfn(von="1"b=b)},
^
SyntaxError: expression expected after dictionary key and ':'
While on python 3.8 it was more helpful:
File "test.py", line 3
"bar":lambda b:{"bar":testfn(von="1"b=b)},
^
SyntaxError: invalid syntax
edit: added triple backquotes to preserve formatting on github. thanks hauntsaninja.
On 3.10.5 it is pointing on the ":" prior to lambda, while on 3.8 it is pointing on the missing comma.
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error