<div>I agree that using multi-line strings as literals comes across as an ugly hack, even if it is BDFL-approved.<br><br>Your other point is valid, though as far as I can tell it's only an issue when the comment is indented less than it ought to be (and starts with "<font face="courier new,monospace">#:</font>", of course):<br>
<br><font face="courier new,monospace">#: Valid either way. The next line has the</font></div><div><font face="courier new,monospace">#: same level of indentation, so it's not</font></div><div><font face="courier new,monospace">#: counted as part of the block.</font></div>
<div><font face="courier new,monospace">print('a')</font></div><div><font face="courier new,monospace"><br></font></div><div><font face="courier new,monospace"># Causes an IndentationError in existing code.</font></div>
<div><font face="courier new,monospace">#:</font></div><div><font face="courier new,monospace">    print('b')</font></div><div><font face="courier new,monospace"><br>def foo():</font></div><div><font face="courier new,monospace">#: This one would break.</font></div>
<div><font face="courier new,monospace">    print('c')</font><br></div><br><div class="gmail_quote">On Fri, Jun 15, 2012 at 8:04 AM, Robert Kern <span dir="ltr"><<a href="mailto:robert.kern@gmail.com" target="_blank">robert.kern@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 6/15/12 11:49 AM, Sven Marnach wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Robert Kern schrieb am Fri, 15. Jun 2012, um 10:50:40 +0100:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Multi-line string literals aren't comments. They are multi-line<br>
string literals. Unlike a comment, which does not show up in the<br>
compiled bytecode, the Python interpreter actually does something<br>
with those string literals. Sometimes people abuse them as ways to<br>
poorly emulate block comments, but this is an abuse, not a feature<br>
of the language.<br>
</blockquote>
<br>
Multi-line string literals do not generate code in CPython, and their<br>
use as comments has BDFL approval:<br>
<br>
     <a href="https://twitter.com/gvanrossum/status/112670605505077248" target="_blank">https://twitter.com/gvanrossum/status/112670605505077248</a><br>
</blockquote>
<br>
Well fancy that.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Robert Kern<br>
<br>
"I have come to believe that the whole world is an enigma, a harmless enigma<br>
 that is made terrible by our own mad attempt to interpret it as though it had<br>
 an underlying truth."<br>
  -- Umberto Eco<br>
<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</font></span></blockquote></div><br>