Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #104045

Re: Continuing indentation

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Ethan Furman <ethan@stoneleaf.us>
Newsgroups comp.lang.python
Subject Re: Continuing indentation
Date Fri, 04 Mar 2016 09:36:09 -0800
Lines 52
Message-ID <mailman.194.1457112982.20602.python-list@python.org> (permalink)
References <mailman.113.1456951421.20602.python-list@python.org> <8760x4bo5h.fsf@elektro.pacujo.net> <mailman.120.1456956006.20602.python-list@python.org> <871t7sbkex.fsf@elektro.pacujo.net> <nb9o0o$ndv$1@reader1.panix.com> <87vb53se36.fsf@elektro.pacujo.net> <56d8d33d$0$1585$c3e8da3$5496439d@news.astraweb.com> <56D8DF99.6070808@lucidity.plus.com> <mailman.176.1457054639.20602.python-list@python.org> <56d905a7$0$1605$c3e8da3$5496439d@news.astraweb.com> <am3oqc-17e.ln1@esprimo.zbmc.eu> <sAgCy.1286660$wX5.1145394@fx40.am4> <CALwzid=n-FUPuZwVSgQuKt0ceBrxQUz3n_WxPkXyoXgW8trsDg@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de +nq0D227q8356MNLmhBYHgHBsDNlFHhmExlMP1KGW0Uw==
Return-Path <ethan@stoneleaf.us>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'operator': 0.03; 'binary': 0.05; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'logic': 0.09; 'message- id:@stoneleaf.us': 0.09; 'operator,': 0.09; 'splitting': 0.09; ':-)': 0.12; '2016': 0.16; 'agree.': 0.16; 'pep8': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'why,': 0.16; 'wrote:': 0.16; '>>>': 0.20; 'preferred': 0.20; "aren't": 0.22; 'arguments': 0.22; 'am,': 0.23; 'code,': 0.23; 'seems': 0.23; 'split': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'fri,': 0.27; 'found.': 0.27; 'tend': 0.27; 'correct': 0.28; 'function': 0.28; 'indentation': 0.29; 'pep': 0.29; 'unlikely': 0.29; '~ethan~': 0.29; "i'm": 0.30; "d'aprano": 0.33; 'steven': 0.33; "i'll": 0.33; 'next': 0.35; 'could': 0.35; 'something': 0.35; 'there': 0.36; 'url:org': 0.36; 'to:addr :python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'wrong': 0.38; 'end': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'charset:windows-1252': 0.62; 'more': 0.63; 'mar': 0.65; 'believe': 0.66; '>>>>>': 0.66; 'aaa': 0.84; 'yyy': 0.97
User-Agent Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
In-Reply-To <CALwzid=n-FUPuZwVSgQuKt0ceBrxQUz3n_WxPkXyoXgW8trsDg@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:104045

Show key headers only | View raw


On 03/04/2016 07:25 AM, Ian Kelly wrote:
> On Fri, Mar 4, 2016 at 7:03 AM, alister <alister.ware@ntlworld.com> wrote:
>> On Fri, 04 Mar 2016 10:12:58 +0000, cl wrote:
>>
>>> Steven D'Aprano <steve@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.
>>
>> not at all
>> the split after the operator shows that their is more to that line
>> splitting before & the reader could believe that the condition ends there
>>
>> PEP 8 is mos definitely correct on this one
>
> I disagree. When I'm skimming over code, I find it unlikely that I'll
> read the last token of the line. That's where trivialities like
> arguments to function calls are found. It's much more likely that I'll
> read the first token of the next line.

And, as any pythonista knows: The conditions aren't over until the 
indentation changes.  ;)

--
~Ethan~

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Continuing indentation Skip Montanaro <skip.montanaro@gmail.com> - 2016-03-02 14:43 -0600
  Re: Continuing indentation Marko Rauhamaa <marko@pacujo.net> - 2016-03-02 22:50 +0200
    Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-02 14:01 -0800
      Re: Continuing indentation Marko Rauhamaa <marko@pacujo.net> - 2016-03-03 00:10 +0200
        Re: Continuing indentation Skip Montanaro <skip.montanaro@gmail.com> - 2016-03-02 16:44 -0600
        Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-02 14:51 -0800
        Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-02 14:56 -0800
        Re: Continuing indentation Chris Angelico <rosuav@gmail.com> - 2016-03-03 10:46 +1100
        Re: Continuing indentation Steven D'Aprano <steve@pearwood.info> - 2016-03-03 13:15 +1100
        Re: Continuing indentation John Gordon <gordon@panix.com> - 2016-03-03 16:16 +0000
          Re: Continuing indentation Marko Rauhamaa <marko@pacujo.net> - 2016-03-03 18:47 +0200
            Re: Continuing indentation Rob Gaddi <rgaddi@highlandtechnology.invalid> - 2016-03-03 18:06 +0000
              Re: Continuing indentation Marko Rauhamaa <marko@pacujo.net> - 2016-03-03 21:36 +0200
            Re: Continuing indentation Steven D'Aprano <steve@pearwood.info> - 2016-03-04 11:13 +1100
              Re: Continuing indentation INADA Naoki <songofacandy@gmail.com> - 2016-03-04 09:45 +0900
              Re: Continuing indentation Erik <python@lucidity.plus.com> - 2016-03-04 01:06 +0000
              Re: Continuing indentation INADA Naoki <songofacandy@gmail.com> - 2016-03-04 10:23 +0900
                Re: Continuing indentation Steven D'Aprano <steve@pearwood.info> - 2016-03-04 14:48 +1100
                Re: Continuing indentation cl@isbd.net - 2016-03-04 10:12 +0000
                Re: Continuing indentation alister <alister.ware@ntlworld.com> - 2016-03-04 14:03 +0000
                Re: Continuing indentation Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-04 08:25 -0700
                Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-04 09:36 -0800
                Re: Continuing indentation sohcahtoa82@gmail.com - 2016-03-04 13:14 -0800
                Re: Continuing indentation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-04 21:20 +0000
                Re: Continuing indentation Erik <python@lucidity.plus.com> - 2016-03-04 23:31 +0000
                Re: Continuing indentation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-04 23:45 +0000
                Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-04 15:53 -0800
                Re: Continuing indentation Simon Ward <simon+python@bleah.co.uk> - 2016-03-05 00:23 +0000
                Re: Continuing indentation sohcahtoa82@gmail.com - 2016-03-04 17:17 -0800
                Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-04 18:14 -0800
                Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-05 13:22 +1100
                Re: Continuing indentation Tim Chase <python.list@tim.thechases.com> - 2016-03-04 20:49 -0600
                Re: Continuing indentation srinivas devaki <mr.eightnoteight@gmail.com> - 2016-03-05 10:25 +0530
                Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-05 16:10 +1100
                Re: Continuing indentation Erik <python@lucidity.plus.com> - 2016-03-05 00:52 +0000
                Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-05 12:05 +1100
                Re: Continuing indentation Erik <python@lucidity.plus.com> - 2016-03-05 01:45 +0000
                Re: Continuing indentation Steven D'Aprano <steve@pearwood.info> - 2016-03-05 18:17 +1100
                Re: Continuing indentation alister <alister.ware@ntlworld.com> - 2016-03-04 13:59 +0000
                Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-05 10:41 +1100
                Re: Continuing indentation sohcahtoa82@gmail.com - 2016-03-04 16:06 -0800
                Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-05 11:30 +1100
                Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-04 17:01 -0800
              Re: Continuing indentation Erik <python@lucidity.plus.com> - 2016-03-04 02:24 +0000
              Re: Continuing indentation Marko Rauhamaa <marko@pacujo.net> - 2016-03-04 08:28 +0200
  Re: Continuing indentation codewizard@gmail.com - 2016-03-02 15:46 -0800
    Re: Continuing indentation Chris Angelico <rosuav@gmail.com> - 2016-03-03 10:54 +1100
      Re: Continuing indentation Pete Forman <petef4+usenet@gmail.com> - 2016-03-03 00:23 +0000
    Re: Continuing indentation Carl Meyer <carl@oddbird.net> - 2016-03-02 17:02 -0700
      Re: Continuing indentation Steven D'Aprano <steve@pearwood.info> - 2016-03-03 13:22 +1100
        Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-03 13:30 +1100
        Re: Continuing indentation Chris Angelico <rosuav@gmail.com> - 2016-03-03 13:33 +1100
        Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-02 18:57 -0800
    Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-03 11:30 +1100
    Re: Continuing indentation cl@isbd.net - 2016-03-03 10:22 +0000

csiph-web