You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
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:
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377
But running under 3.10.0 I get:
File "/Users/jeremyp/tmp/nodent.py", line 3
"""Print a Fibonacci series up to n."""
IndentationError: expected an indented block after function definition on line 1
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?
New changeset 3fc8b74 by Pablo Galindo Salgado in branch '3.10':
[3.10] bpo-46091: Correctly calculate indentation levels for whitespace lines with continuation characters (GH-30130). (GH-30898) 3fc8b74