-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse error when missing commas is inconsistent #89890
Comments
I found following inconsistency in the error message when there's a missing comma (it behaves that way both on main and 3.10). Here's what happens with numbers, as expected: Python 3.11.0a1+ (heads/main:32f55d1a5d, Nov 5 2021, 13:18:52) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1 2 3 4
File "<stdin>", line 1
1 2 3 4
^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma? But with names the error is further right in the lines: >>> a b c d
File "<stdin>", line 1
a b c d
^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
>>> a b c d e f g
File "<stdin>", line 1
a b c d e f g
^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma? That looks potentially quite confusing to me? (I don't know if these nit-picky parsing issues are too annoying, if they are please tell me to stop filing them). |
Don't worry, I think is great to discuss these cases. If there are too many, then maybe it will take a while to correct, but please, don't stop :)
I agree is unfortunate that is inconsistent, but unfortunately, this is going to be a bit of a pain because the way the expression rule is reached. I will try to see if we can easily fix this without having to restructure a bunch of the grammar |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: