[Python-ideas] PEP8 operator must come before line break
Joseph Martinot-Lagarde
contrebasse at gmail.com
Thu Apr 14 15:28:39 EDT 2016
Guido van Rossum <guido at ...> writes:
> 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?
I personally tend to look more at the start of the lines because that's
where the blocks are defined (by indentation). Also the end of the lines are
usually not aligned which makes binary operators harder to see.
Because of these two reasons I always put binary operator at the start of
new lines, because that's where I have the most chance to see them, and I'm
in favor of changing this in PEP8.
More information about the Python-ideas
mailing list