-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-parsertype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
After 6bc65c3 is merged, there's one more case we can handle. See this todo:
cpython/Lib/test/test_syntax.py
Lines 2693 to 2696 in 6bc65c3
>>> # TODO(@sobolevn): improve this message in the next PR | |
>>> assert a := 1 | |
Traceback (most recent call last): | |
SyntaxError: invalid syntax |
What happens? assert
does not allow :=
without ()
in its body.
We need to improve the error message, because current state is not really clear for the user. Why there's a syntax error? How to fix it?
Refs #136616
Linked PRs
Metadata
Metadata
Assignees
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-parsertype-featureA feature request or enhancementA feature request or enhancement