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


Groups > comp.lang.python > #104041

Re: Continuing indentation

Path csiph.com!feeder.erje.net!2.eu.feeder.erje.net!newsfeed.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!not-for-mail
From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: Continuing indentation
Date Fri, 4 Mar 2016 08:25:49 -0700
Lines 44
Message-ID <mailman.191.1457105192.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>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de 3+P3LgaDM7XdAw+dvKSmDgIjqMF045K3EHpiNobqYKpg==
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'operator': 0.03; 'received:209.85.223': 0.03; 'binary': 0.05; 'logic': 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; 'arguments': 0.22; 'am,': 0.23; 'code,': 0.23; 'seems': 0.23; 'split': 0.23; 'header:In-Reply-To:1': 0.24; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'found.': 0.27; 'tend': 0.27; 'correct': 0.28; 'function': 0.28; 'pep': 0.29; 'unlikely': 0.29; "i'm": 0.30; "d'aprano": 0.33; 'steven': 0.33; "i'll": 0.33; 'received:google.com': 0.35; 'next': 0.35; 'could': 0.35; 'something': 0.35; 'there': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'wrong': 0.38; 'end': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'more': 0.63; 'mar': 0.65; 'believe': 0.66; 'aaa': 0.84; 'to:name:python': 0.84; 'yyy': 0.97
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=x6pJnhLarZK2tWm/MOevnP9t4wTwBD/uSCOdQhD0Eqs=; b=yarFgrMo8AUrheg5x+ENrbXBAkr+Xzo/digR5ouLQGqyjF+aBvbee+mN6le85RnzEg POdy9vYvREvcQOrC5oiovneQ8nGkcZhI8eXILOp7JgMIdBgJf6rdEv5opVummwiAss3r 6/Uw+7ZLTYcyCesk9gQB82vfOQqkwgZLoOs1TRFI1aaAheYPeeNKv/3s7EMW5WzAZAMd ZVK7j23pBmwsj0GTDXfSOlUvQs9/OAg2LKDZGFz1VtI0Rt6bIjYG6K9ZJEtCyHJQLthm 81+4yxZM7AcPuBxyqyWaRuYR39/ABydOT4cfAYhl53XWEfK448ikwimT2qvyNPx1dRxa VHFQ==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=x6pJnhLarZK2tWm/MOevnP9t4wTwBD/uSCOdQhD0Eqs=; b=IlpGPmxk227/x1OmuRoPkXQgzy8B/axqCjF1yGVXQjmNrhm488F5h8viDpKAJMu766 AXuI929puQ28VYIgd7SvI1vITYPiHykMyRtUsLlAr4dg5WUeeWabWojQ9sHgiRSI0asp FDrhVR6FRv1mQZzXRO90AGe2mkZYWsYL2xPSLTH6+lSAcaBojiBkRwWa29xOdhm5FsUI N508fODF9Vio8YNQeSSUp7LPVQ1NjJgzEU1PRgfoasJBa84C1p/U0T4kp2AfAN4myOt2 OLjnhw3sH4sN9qJig14qwM7QL6POrcCvQSPV5QOFM0i1z2DLosCLFBxreyV56WDHVM7X +3tg==
X-Gm-Message-State AD7BkJLGpkgB7i9yKnYvztRo972FvXL25w4PSRW6kcFDa0RqVKrVvzId6aC2I5DeXrGY7OVKxrKVyha2qCt+qw==
X-Received by 10.107.19.140 with SMTP id 12mr5837378iot.11.1457105189077; Fri, 04 Mar 2016 07:26:29 -0800 (PST)
In-Reply-To <sAgCy.1286660$wX5.1145394@fx40.am4>
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:104041

Show key headers only | View raw


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.

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