<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>> </span><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">Every language with blocks needs some mechanism to indicate the beginning and ending of blocks and of statements within blocks. If visible fences ('begin/end' or '{}') and statement terminators (';') are used, then '\n' can be treated as merely a space, as it is in C, for instance. </span><br></div><div><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">> </span><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">and it uses unescaped '\n' (with two escapement options) to terminate statements. This is fundamental to Python's design and goes along with significant indents.</span></div><div><span
class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; "><br></span></div><div><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">Agreed. </span><span class="Apple-style-span" style="font-family: times, serif; ">Currently indentation in Python starts a new block, </span><span class="Apple-style-span" style="font-family: times, serif; ">but if you view it from the perspective of line breaking, </span><span class="Apple-style-span" style="font-family: times, serif; ">it also functions as if the line is continued. The line of code below</span></div><span class="Apple-style-span" style="font-family: times, serif; "><div id="yiv97791614"><br></div><div id="yiv97791614">if condition: do_a(); do_b()</div><div id="yiv97791614"><br></div><div id="yiv97791614">can be written as:</div><div id="yiv97791614"><br></div><div id="yiv97791614">if condition: #line
breaks</div><div id="yiv97791614"><span class="yiv97791614Apple-tab-span" style="white-space: pre; "> </span>do_a(); # ';' is optional here </div><div id="yiv97791614"><span class="yiv97791614Apple-tab-span" style="white-space: pre; "> </span>do_b() # continue</div><div id="yiv97791614"><br></div></span><div><span>That indentation can be also employed for line breaking is quite evident to me. During the open email correspondence with Stephen, it seems to be a tenable point. </span></div><div><br></div><div>> <span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">There would then be three ways to escape newline, with one doing double duty. And for what? Merely to avoid using either of the two methods already available.</span></div><div><br></div><div>I believe the other two ways are not as good as this new way. As the proposal is fully backward compatible, people may choose whatever way they
prefer. <br><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> Terry Reedy <tjreedy@udel.edu><br><b><span style="font-weight: bold;">To:</span></b> python-list@python.org<br><b><span style="font-weight: bold;">Cc:</span></b> python-ideas@python.org<br><b><span style="font-weight: bold;">Sent:</span></b> Sunday, September 4, 2011 3:01 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Python-ideas] allow line break at operators<br></font><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.
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 beginning and ending of blocks and of statements within blocks. If visible fences ('begin/end' or '{}') and statement terminators (';') are used, then '\n' can be treated as merely a space, as it is in C, for instance.<br><br>> Python uses indentation for blocks,<br><br>and it uses unescaped '\n' (with two escapement options) to terminate statements. This is fundamental to Python's design and 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 jobs in the form of a grammar that works with Python's parser. I am 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 would then be three ways to escape newline, with one doing double duty. And for what? Merely to avoid using either of the two methods already available.<br><br>-- Terry Jan Reedy<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>