[Python-ideas] Allowing comments after line continuations

Greg Ewing greg.ewing at canterbury.ac.nz
Fri May 17 00:26:58 CEST 2013


Terry Jan Reedy wrote:
> In a string, \ escapes the immediate next character. This idea of \ at 
> the *end* of a line, just before the newline character, is that it 
> escapes the newline, *just as is does within a string*.

That's how it currently works, but that doesn't mean it's
how it *should* work. Especially if it leads to counter-
intuitive and less-than-useful behaviour, which IMO it
does.

In between tokens, we expect whitespace to be treated
flexibly, in the sense that wherever one whitespace
character is allowed, we can substitute more than one.
Line continuation with backslash currently breaks that
expectation.

-- 
Greg


More information about the Python-ideas mailing list