Re:Space After Periods (1993)
by thaumasiotes on Wednesday July 12, 2023 @06:13PM
(#36702390)
Yes, you've misunderstood. If the last line started with 8 spaces, Python will see a difference between (the next line starting with 8 spaces), (the next line starting with 6 spaces), and (the next line starting with 10 spaces). Option 1 does nothing. Option 2 produces a DEDENT token. And option 3 produces an INDENT token.
In the same scenario, Python does not distinguish between (the next line starting with 10 spaces), which produces an INDENT token, and (the next line starting with 50 spaces), which produces the same INDENT token. The amount of whitespace isn't relevant. All that matters is the comparison between one line and the previous line.
Perhaps I misunderstood your comment, but this is quite wrong. If I have a block that's indented at 8 spaces, and the next line is 10 spaces, but should be in the same block, it will definitely throw an IndentationError.