<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="font-family: -webkit-monospace; font-size: 12px; ">On Sun, 8 Feb 2009 03:17:25 -0330<br>Riobard Zhan <<a href="mailto:yaogzhan@gmail.com">yaogzhan@gmail.com</a>> wrote:<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">On 6-Feb-09, at 8:41 PM, Mike Meyer wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite">That this consistency - ignoring trailing separators in list<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">structures - can be misunderstood to be an optional ending separator<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">in the degenerate case of a single statement is a good indication of<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">why consistency isn't a trump property.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">This is a very strange view of consistency to me. How many different  <br></blockquote><blockquote type="cite">kinds of list separators do we have? I can only think of semicolons  <br></blockquote><blockquote type="cite">and commas. I don't think semicolons are anything like commas. Non- <br></blockquote><blockquote type="cite">trailing semicolons can be omitted, while non-trailing commas cannot,  <br></blockquote><blockquote type="cite">even if you put each item of [1,2,3] in separate lines.</blockquote></span></div><div><br></div><div>Oops, I thought I missed a clause. The last sentence should be "<span class="Apple-style-span" style="font-family: -webkit-monospace; font-size: 12px; ">Non-trailing semicolons can be omitted [if you put each statement in its own line], while non-trailing commas cannot, even if you put each item of [1,2,3] in separate lines."</span></div><div><div><br></div><div><br></div><div>On 8-Feb-09, at 3:34 AM, Mike Meyer wrote:</div><blockquote type="cite"><div>You still don't understand the semantics of semicolons.  Non-trailing<br>semicolons are required, and can *not* be omitted. Try it and see:<br><br>bhuda$ python<br>Python 2.6 (r26:66714, Nov 11 2008, 07:45:20) <br>[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7<br>Type "help", "copyright", "credits" or "license" for more information.<br><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">a = 1; b = 2<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">a = 1 b = 2<br></blockquote></blockquote></blockquote>  File "<stdin>", line 1<br>    a = 1 b = 2<br>          ^<br>SyntaxError: invalid syntax<br><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><br>Only *trailing* semicolons - the one following the last statement in<br>the list - can be omitted. Just like lists in list literals, in tuple<br>literals (module zero & one element tuples), in dictionary literals,<br>and as arguments to certain types of functions functions.<br></div></blockquote><div><br></div><div><br></div><div>I'm really confused by your words. Here is a list of statements. </div><div><br></div><div>a = 1; # non-trailing semicolon of the list of statements</div><div>b = 2; # trailing semicolon of the list of statements</div><div><br></div>Both semicolons can be omitted. <br><div><br></div><div><br></div><div>Wait a minute... What do you mean by a "list" of statements? Is this one list of length 2, or two lists of length 1? </div><div><br></div><div>a = 1</div><div>b = 2</div></div></body></html>