-
Notifications
You must be signed in to change notification settings - Fork 109
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
Python 3.10: Parenthesized context managers #203
Comments
Moved to parso. As you said this is a more general issue with the PEG grammar (parso is only able to parse LL at the moment). |
@davidhalter if we agree on some sort of a verification process (or use the existing syntax error generation), we could simply add a rule like this:
Which in theory (and also in practice, currently used by black) allows parenthesized context managers. Then if this is used anywhere outside of a with-statement's context expression, we would raise an error. This would be another inconsistency in the grammar that would be eliminated in a later stage, just like the LHS of many expressions. Not sure if you think this would worth the effort without the full pattern matching stuff though. |
Yeah, that's mostly what I'm worried about as well. It's a good idea, but full pattern matching is probably the more pressing issue. |
Besides match case, python 3.9 alpha6 / 3.10 also added parenthesized imports and context-managers.
Parenthesized imports works no problem in jedi, but parenthesized context managers lead to a syntax error:
See:
Probably relates to:
The text was updated successfully, but these errors were encountered: