Continuing indentation

cl at isbd.net cl at isbd.net
Fri Mar 4 05:12:58 EST 2016


Steven D'Aprano <steve at pearwood.info> wrote:
> On Fri, 4 Mar 2016 12:23 pm, INADA Naoki wrote:
> 
> >>
> >>
> >> Indeed. I don't understand why, when splitting a condition such as this,
> >> people tend to put the operator at the end of each line.
> >>
> >>
> > Because PEP8 says:
> > 
> >> The preferred place to break around a binary operator is after the
> > operator, not before it.
> > http://pep8.org/#maximum-line-length
> 
> PEP 8 is wrong :-)
> 
Yes, I agree.  In my mind the logic is:-

    IF xxx
        AND yyy
        AND zzz
        OR aaa
    THEN do something

The PEP8 correct(er):-

    IF xxx AND
         yyy AND
         zzz OR
         aaa
    THEN do something

... just seems all wrong and difficult to understand.

-- 
Chris Green
·



More information about the Python-list mailing list