[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-ideas
Subject:    Re: [Python-ideas] Allowing comments after line continuations
From:       Bruce Leban <bruce () leapyear ! org>
Date:       2013-05-17 21:04:08
Message-ID: CAGu0AnuXiqBsGseetFzmJbf1OsMua3bonvdZG2g924MCV4drSw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Fri, May 17, 2013 at 1:06 PM, Terry Jan Reedy <tjreedy@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

[Attachment #5 (text/html)]

<br><div class="gmail_quote">On Fri, May 17, 2013 at 1:06 PM, Terry Jan Reedy <span \
dir="ltr">&lt;<a href="mailto:tjreedy@udel.edu" \
target="_blank">tjreedy@udel.edu</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">

<div id=":3c" style="overflow:hidden">&#39;Escape&#39; means &#39;ignore the normal \
meaning of the following character&#39;.<br></div></blockquote></div><div><br></div>\ \
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.<div>

<br></div><div>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.)</div>

<div><br></div><div>So in this case, while the current escape sequence is <font \
face="courier new, monospace">\&lt;newline&gt;</font>, the new proposed one is \
</div><div><font face="courier new, monospace"><br></font></div>

<blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font \
face="courier new, monospace">\&lt;whitespace-other-than-newline&gt;*[#&lt;anything-but-newline&gt;*]&lt;newline&gt;</font></div></blockquote><div>
 <font face="courier new, monospace"><br>
</font></div><div><font face="arial, helvetica, sans-serif">Or writing this in the \
style used in the python docs:</font></div><div><font face="arial, helvetica, \
sans-serif"><br></font></div><blockquote style="margin:0 0 0 \
40px;border:none;padding:0px">

<div><font face="courier new, monospace">&quot;\&quot; <u>whitespace</u></font><font \
face="courier new, monospace"><u>-other-than-newline</u></font><span \
style="font-family:&#39;courier new&#39;,monospace"> * [ &quot;#&quot; </span><u \
style="font-family:&#39;courier new&#39;,monospace">anything-but-newline</u><span \
style="font-family:&#39;courier new&#39;,monospace"> * ] </span><u \
style="font-family:&#39;courier new&#39;,monospace">newline</u></div>

</blockquote><div><br></div><div>I understand if you disagree with the proposal. But \
I don&#39;t think an argument that it is fundamentally ill-defined and ignorant of \
history is valid.</div><div><br clear="all"><div><font face="arial, helvetica, \
sans-serif">--- Bruce</font><div>

<span style="font-family:arial,helvetica,sans-serif">Latest blog post: Alice&#39;s \
Puzzle Page </span><a href="http://www.vroospeak.com/" \
style="font-family:arial,helvetica,sans-serif" \
target="_blank">http://www.vroospeak.com</a></div>

<div><div><font face="arial, helvetica, sans-serif">Learn how hackers think: <a \
href="http://j.mp/gruyere-security" \
target="_blank">http://j.mp/gruyere-security</a></font></div></div></div> </div>



_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
http://mail.python.org/mailman/listinfo/python-ideas


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic