[Python-ideas] PEP8 operator must come before line break
SW
walker_s at hotmail.co.uk
Thu Apr 14 14:48:23 EDT 2016
That'll teach me for stepping away from the computer...
As for changing an established rule, I agree that can be difficult. The
reason this one became an irritation for me is that it was only in the
last few months that I saw flake8 (my style complainer of choice) start
complaining about this, so it's not quite so entrenched as other
elements of style.
I agree that placing the binary operator at the end shows the line
should continue, and thus could be valid, but I also think that placing
it at the start of the next line shows the logic flow for each part of
the expression more clearly- as shown in the examples I originally gave.
Thanks,
S
On 14/04/16 18:23, Guido van Rossum wrote:
> Thanks, that was obviously an oversight. I've fixed the PEP.
>
> If the discussion ends up with rough consensus on changing this I will
> happily change it back (and change all other occurrences to match the
> new rule).
>
> Note that my request for "rough consensus" does *not* imply a vote. +1
> and -1 votes (nor fractions in between) should not be posted --
> however cogent arguments for/against the status quo (or for
> relinquishing the rule altogether) are welcome.
>
> On Thu, Apr 14, 2016 at 10:02 AM, Matthias welp <boekewurm at gmail.com> wrote:
>>> Where in PEP 8 does it violate its own advice
>> As the OP did not reply this fast, from the webpage (/dev/peps/pep-0008)
>>
>> section indentation, just after 'Acceptable options in this situation
>> include, but are not limited to: '
>>
>> # Add some extra indentation on the conditional continuation line.
>> if (this_is_one_thing
>> and that_is_another_thing):
>> do_something()
>>
>> That is the only place I could find just now.
>>
>>
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> https://mail.python.org/mailman/listinfo/python-ideas
>> Code of Conduct: http://python.org/psf/codeofconduct/
>
>
More information about the Python-ideas
mailing list