[Python-ideas] PEP8 operator must come before line break
Guido van Rossum
guido at python.org
Thu Apr 14 13:02:02 EDT 2016
On Thu, Apr 14, 2016 at 9:58 AM, Random832 <random832 at fastmail.com> wrote:
> On Thu, Apr 14, 2016, at 12:35, Guido van Rossum wrote:
>> Where in PEP 8 does it violate its own advice? That's a bug. (The PEP
>> has many authors by now.)
>>
>> As the PEP acknowledges, style is hard to agree over. It's even harder
>> to change an agreement that has been documented (if not always
>> followed consistently) for over 20 years.
>>
>> My rationale for this rule is that ending a line in a binary operator
>> is a clear hint to the reader that the line isn't finished. (If you
>> think about it, a comma is a kind of binary operator, and you wouldn't
>> move the comma to the start of the continuation line, would you? :-)
>
> Well, yes, but "and" and "or" are English conjunctions in addition to
> being binary operators and, a line break is a natural break in reading
> and, something flows more naturally if you pause before conjunctions
> rather than after them or, am I completely wrong about that?
>
> What I'm saying is, maybe there should be a separate rule for "and" and
> "or" in certain contexts, rather than a universal rule for all binary
> operators.
OK, do you want to moderate the discussion about that particular
issue? If you can gather support from some of the usual suspects I'm
not against being persuaded.
--
--Guido van Rossum (python.org/~guido)
More information about the Python-ideas
mailing list