Have you considered line continuation by indentation? It seems to meet the 
design principle. I think it is the most natural way to allow free line 
breaking in Python.

(Sorry, the yahoo web email interface is so weird that I don't know how to 
format comments between the quoted message below.)




>________________________________
>From: Stephen J. Turnbull <[email protected]>
>To: Gabriel AHTUNE <[email protected]>
>Cc: Matt Joiner <[email protected]>; "[email protected]" 
><[email protected]>; python-ideas <[email protected]>; Yingjie Lan 
><[email protected]>
>Sent: Friday, September 2, 2011 3:28 PM
>Subject: Re: [Python-ideas] allow line break at operators
>
>Gabriel AHTUNE writes:
>> So can be done with this syntax:
>> 
>> > x = firstpart * secondpart  +  #line breaks here
>> > anotherpart + #continue
>> > stillanother #continue on.
>> 
>> after a "+" operator the line is clearly not finished yet.
>
>Sure, but IIRC one design principle of Python is that the keyword that
>denotes the syntax should be the first thing on the line, making it
>easy to scan down the left side of the code to see the syntactic
>structure.  The required indentation of the controlled suite also
>helps emphasize that keyword.
>
>Analogously, if operators are going to denote continuation, they
>should come first on the line.
>
>
>
>I just don't think this idea is going anywhere.  Explicit continuation
>with backslash or implicit continuation of parenthesized expressions
>is just not that heavy a price to pay.  Perhaps historically some of
>these ideas could have been implemented, but now they're just going to
>confuse a host of editors and code analysis tools.
>
>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to