[Python-ideas] Allowing comments after line continuations

Bruce Leban bruce at leapyear.org
Fri May 17 23:04:08 CEST 2013


On Fri, May 17, 2013 at 1:06 PM, Terry Jan Reedy <tjreedy at udel.edu> wrote:

> 'Escape' means 'ignore the normal meaning of the following character'.
>

\ is not only an escape character as you define it. Sometimes it means the
exact opposite of that: the following character has special meaning, e.g.,
\n \t etc.

And it is also not the case that \ only applies to the single following
character. \123 is a four-character escape sequence, \u1234 is a
six-character sequence and \U12345678 is a ten-character sequence! (And
Python is not the only language that recognizes long escape sequences.)

So in this case, while the current escape sequence is \<newline>, the new
proposed one is

\<whitespace-other-than-newline>*[#<anything-but-newline>*]<newline>


Or writing this in the style used in the python docs:

"\" *whitespace**-other-than-newline* * [ "#" *anything-but-newline* * ] *
newline*


I understand if you disagree with the proposal. But I don't think an
argument that it is fundamentally ill-defined and ignorant of history is
valid.

--- Bruce
Latest blog post: Alice's Puzzle Page http://www.vroospeak.com
Learn how hackers think: http://j.mp/gruyere-security
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130517/b50b7987/attachment.html>


More information about the Python-ideas mailing list