<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><blockquote class="webkit-indent-blockquote" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div></blockquote><div style="font-family: arial, helvetica, sans-serif; ">Thanks, I think that's the rule described in its full glory. Currently I am not  quite sure of the use case for continuation nested in continuation -- it seems to be still a single continuation, but it allows for some additional freedom in formatting the continued line. Do you have other use cases for that?<br></div><div style="font-family: arial, helvetica, sans-serif; "><br></div><div
 style="font-family: arial, helvetica, sans-serif; ">For the case of mis-indentation, as demonstrated in your scenario, I think it is better that the rule is not applied to a comment continued onto the next line. The effect of a '#' only carries to the end of a line, if one would like the next line to be a comment, just use another '#'. It remains to consider a mis-indentation that only involves code lines. However, that is not a new problem, so we should not worry (it is like a sunken cost). </div><div style="font-family: arial, helvetica, sans-serif; "><br></div><div style="font-family: arial, helvetica, sans-serif; "><div style="font-family: arial, helvetica, sans-serif; ">Sorry for top posting. It seems yahoo web email is not designed with such a use case in mind.</div><div><br></div></div><div style="font-family: arial, helvetica, sans-serif; "><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left:
 5px;"><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> MRAB <python@mrabarnett.plus.com><br><b><span style="font-weight: bold;">To:</span></b> python-list@python.org<br><b><span style="font-weight: bold;">Sent:</span></b> Sunday, September 4, 2011 10:04 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Python-ideas] allow line break at operators<br></font><br>On 04/09/2011 00:22, Yingjie Lan wrote:<br>>>  Every language with blocks needs some mechanism to indicate the<br>> beginning and ending of blocks and of statements within blocks. If<br>> visible fences ('begin/end' or '{}') and statement terminators (';') are<br>> used, then '\n' can be treated as merely a space, as it is in C, for<br>>
 instance.<br>>>  and it uses unescaped '\n' (with two escapement options) to terminate<br>> statements. This is fundamental to Python's design and goes along with<br>> significant indents.<br>><br>> Agreed. Currently indentation in Python starts a new block, but if you<br>> view it from the perspective of line breaking, it also functions as if<br>> the line is continued. The line of code below<br>><br>> if condition: do_a(); do_b()<br>><br>> can be written as:<br>><br>> if condition: #line breaks<br>> do_a(); # ';' is optional here<br>> do_b() # continue<br>><br>> That indentation can be also employed for line breaking is quite evident<br>> to me. During the open email correspondence with Stephen, it seems to be<br>> a tenable point.<br>><br>>  > There would then be three ways to escape newline, with one doing<br>> double duty. And for what? Merely to avoid using either of
 the two<br>> methods already available.<br>><br>> I believe the other two ways are not as good as this new way. As the<br>> proposal is fully backward compatible, people may choose whatever way<br>> they prefer.<br>><br>I think that the rules would be:<br><br>If a line ends with a colon and the next line is indented, then it's<br>the start of a block, and the following lines which belong to that<br>block have the same indent.<br><br>If a line doesn't end with a colon but the next line is indented, then<br>it's the start of a continuation, and the following lines which belong<br>to that continuation have the same indent.<br><br>In both cases there could be blocks nested in blocks and possibly<br>continuations nested in continuations, as well as blocks nested in<br>continuations and continuations nested in blocks.<br><br>I'm not sure what the effect would be if you had mis-indented lines.<br>For example, if a line was accidentally
 indented after a comment, then<br>it would be treated as part of the comment. It's in cases like those<br>that syntax colouring would be helpful. It would be a good idea to use<br>an editor which could indicate in some way when a line is a<br>continuation.<br><br>>     ------------------------------------------------------------------------<br>>     *From:* Terry Reedy <<a ymailto="mailto:tjreedy@udel.edu" href="mailto:tjreedy@udel.edu">tjreedy@udel.edu</a>><br>>     *To:* <a ymailto="mailto:python-list@python.org" href="mailto:python-list@python.org">python-list@python.org</a><br>>     *Cc:* <a ymailto="mailto:python-ideas@python.org" href="mailto:python-ideas@python.org">python-ideas@python.org</a><br>>     *Sent:* Sunday, September 4, 2011 3:01 AM<br>>     *Subject:* Re: [Python-ideas] allow line break at operators<br>><br>>     On 9/3/2011 3:51 AM,
 Yingjie Lan wrote:<br>>      > I agree that long lines of code are not very common in many projects,<br>>      > though it might be the case with some heavily involved in math.<br>>     For some<br>>      > reason, when the feature of free line breaking came about in computer<br>>      > languages, it is welcomed and generally well accepted.<br>><br>>     Every language with blocks needs some mechanism to indicate the<br>>     beginning and ending of blocks and of statements within blocks. If<br>>     visible fences ('begin/end' or '{}') and statement terminators (';')<br>>     are used, then '\n' can be treated as merely a space, as it is in C,<br>>     for instance.<br>><br>>      > Python uses indentation for blocks,<br>><br>>     and it uses
 unescaped '\n' (with two escapement options) to<br>>     terminate statements. This is fundamental to Python's design and<br>>     goes along with significant indents.<br>><br>>      > and by the same mechanism, line breaking can be<br>>      > accommodated without requiring parenthesis or ending backslashes.<br>><br>>     You need proof for your claim that indentation can be used for both<br>>     jobs in the form of a grammar that works with Python's parser. I am<br>>     dubious that you can do that with an indents *after* the newline.<br>><br>>     Even if you could, it would be confusing for human readers. There<br>>     would then be three ways to escape newline, with one doing double<br>>     duty. And for what? Merely to avoid using either of the two methods<br>>     already
 available.<br>><br><br>-- <br><a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br><br><br></div></div></blockquote></div></div></body></html>