-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Quoted annotations should be parsed as if parenthesized #9467
Comments
Should this be implemented in the parser layer or here where we emit the warning? |
I think it should be implemented in the ruff/crates/ruff_python_parser/src/typing.rs Lines 22 to 44 in a0263ab
I would also suggest to look at other references of |
Nice, I can work on this. |
An easy fix here would probably be adding new |
At this point, we'll want the fix here to apply to both ruff and red-knot. |
Agreed. Both ruff and red knot utilizes the ruff/crates/ruff_python_parser/src/lib.rs Lines 157 to 167 in 21aa12a
So, as Micha suggested, we could add a |
It was recently agreed that quoted annotations should be parsed as if they were implicitly wrapped in parentheses. So, e.g., they can contain otherwise-invalid indentation, newlines within binary operators, etc.
See: microsoft/pyright#6940 (comment)
The text was updated successfully, but these errors were encountered: