gh-151128: Improve SyntaxError message for cross language keywords#151129
gh-151128: Improve SyntaxError message for cross language keywords#151129zang-langyan wants to merge 4 commits into
Conversation
zang-langyan
commented
Jun 9, 2026
|
I do not think that it is needed to add 'switch' to keywords. Even if we only add one special case, it is worth to write more general code which will allow to add more keywords in future. See #146407 as example. |
ByteFlowing1337
left a comment
There was a problem hiding this comment.
I do not think this change is correct.
Most of the previous PRs that improved SyntaxError message were implemented by modifying the parser rather than adding if statements in traceback.py. Also, if the entire keyword.softkwlist and switch are passed to _generate_suggestions() as candidates, it may cause unwanted side effects that are completely unrelated to the issue.
Thank you for the reference, it is really a good example. I will look into it. |