-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
IndendationError from multi-line indented statements #90249
Comments
At some point in 3.9 Python appears to have stopped accepting source that starts with an indent, then a '\', then the indented statement. From the lexical analysis 1 "Indentation cannot be split over multiple physical lines using backslashes; the whitespace up to the first backslash determines the indentation." Running the attached program under 3.8.12 I get:
But running under 3.10.0 I get:
Running under 3.9.9 also gives an IndentationError, both with and without -X oldparser. So this doesn't seem directly related to the new parser, but seems likely it is fall out from the general grammar restructuring. IMHO it isn't a particularly nice feature for the language to have. Especially since not all lines like ' \' behave the same. But it was there and documented for many years, so should probably be put back. Does a core developer agree? That the implementation is not following the spec? |
This is a side effect on the fix in: |
Unfortunately I am not sure if this is going to be easier to retrofit for the reasons exposed in the issue. I will try to take a look, but if you have some cycles to spare, a PR would be welcomed. |
nevermind, I am convinced is a bug. I filed a PR for it |
Wow, this was a fast turnaround! I was going to spin some cycles on this, but would have not seen the solution in 50m. |
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: