Re: [Python-ideas] allow line break at operators

I guess the issue here is that you can't tell if an expression is complete without checking the indent of the following line. This is likely not desirable. On Thu, Sep 1, 2011 at 11:43 PM, Yingjie Lan <lanyjie@yahoo.com> wrote:

Gabriel AHTUNE writes:
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.

On Fri, Sep 2, 2011 at 12:28 AM, Stephen J. Turnbull <stephen@xemacs.org> wrote:
That's true for *statements* (except assignments and calls).
Analogously, if operators are going to denote continuation, they should come first on the line.
That doesn't follow. My preferred style is actually to put the binary operator at the end of the line. This also matches the prevailing style for breaking lines after commas (a comma can be seen as a kind of binary operator).
Totally agreed that this isn't going to happen. -- --Guido van Rossum (python.org/~guido)

Guido van Rossum writes:
On Fri, Sep 2, 2011 at 12:28 AM, Stephen J. Turnbull <stephen@xemacs.org> wrote:
That doesn't follow.
Agreed, it's not a logical implication. The analogy is only an analogy, but my eyes do work that way. My conclusion is that we shouldn't try to encourage either style, because people "see" continuation differently. Legislating a style isn't going to change that, I think.

On Sat, 2011-09-03 at 13:38 +0900, Stephen J. Turnbull wrote:
I like to start continued lines with an operator as well. I also think it helps me keep it in my head a bit easier when I do that. I think this is one of those areas where computers and people differ, but it may also depend on the persons native language as to what works better for them. Ron

Gabriel AHTUNE writes:
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.

On Fri, Sep 2, 2011 at 12:28 AM, Stephen J. Turnbull <stephen@xemacs.org> wrote:
That's true for *statements* (except assignments and calls).
Analogously, if operators are going to denote continuation, they should come first on the line.
That doesn't follow. My preferred style is actually to put the binary operator at the end of the line. This also matches the prevailing style for breaking lines after commas (a comma can be seen as a kind of binary operator).
Totally agreed that this isn't going to happen. -- --Guido van Rossum (python.org/~guido)

Guido van Rossum writes:
On Fri, Sep 2, 2011 at 12:28 AM, Stephen J. Turnbull <stephen@xemacs.org> wrote:
That doesn't follow.
Agreed, it's not a logical implication. The analogy is only an analogy, but my eyes do work that way. My conclusion is that we shouldn't try to encourage either style, because people "see" continuation differently. Legislating a style isn't going to change that, I think.

On Sat, 2011-09-03 at 13:38 +0900, Stephen J. Turnbull wrote:
I like to start continued lines with an operator as well. I also think it helps me keep it in my head a bit easier when I do that. I think this is one of those areas where computers and people differ, but it may also depend on the persons native language as to what works better for them. Ron
participants (5)
-
Gabriel AHTUNE
-
Guido van Rossum
-
Matt Joiner
-
ron3200
-
Stephen J. Turnbull