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


Groups > comp.lang.python > #71653

Re: PEP 8 : Maximum line Length :

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; '16,': 0.03; 'assignment': 0.07; 'lines,': 0.07; 'subject:PEP': 0.07; 'pep': 0.09; 'reformat': 0.09; 'terms,': 0.09; 'trailing': 0.09; 'wrapped': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'ast': 0.16; 'conveying': 0.16; 'conveys': 0.16; 'corresponds': 0.16; 'elements,': 0.16; 'examples:': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'obviously,': 0.16; 'stuff.': 0.16; '(you': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'cc:addr:python.org': 0.22; 'circular': 0.24; 'logical': 0.24; 'space.': 0.24; 'cc:2**0': 0.24; 'compare': 0.26; 'order.': 0.26; 'subject: : ': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'skip:( 20': 0.30; 'comments': 0.31; 'lines': 0.31; 'argue': 0.31; 'breaking': 0.31; 'comments,': 0.31; 'indentation': 0.31; 'strip': 0.31; 'though.': 0.31; 'vertical': 0.31; 'text': 0.33; 'fri,': 0.33; 'comment': 0.34; "can't": 0.35; 'case,': 0.35; 'definition': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'useful': 0.36; 'should': 0.36; 'two': 0.37; 'area': 0.37; 'expressed': 0.37; 'pm,': 0.38; 'anything': 0.39; 'how': 0.40; 'information,': 0.61; 'first': 0.61; 'information': 0.63; 'provide': 0.64; 'effectively': 0.66; 'worth': 0.66; 'believe': 0.68; 'lose': 0.68; 'real-world': 0.68; 'characters,': 0.84; 'irrelevant': 0.84; 'presumably': 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=VNY4Wb4dkxg1LDSMM9DX1HLcjK49oQi8+JruXvuhvrI=; b=icBItDxTLziuFePWysGC2L7ZuoAsiLRv802mKTO5pg94fHsIs5HOpwrViqQB48RBY5 DGxb2wpzmUIR3nY5gGI6tZ0b2V9v7TpUSmEkdvbAHOn6zyvDgHEhptuy8/V3K3jv2sD2 jue6oWo7cOBekx3Dk5G57UjL73WH6+ZCPTtzKq0XT2f19f9Hybyj0IxVjHn82VUSvGsL BmkINtrpvulfEdO40AKbHnezI1kva49yycbmP0e3TB/pZjfngkX2vO9GOiiuPaBFBF7n gzgWuP9x3B2LHLa+3c/LPwg8UbuxGSW/uoLJVF554lokJQBOrFvxQjP97zcKTeBE0BN1 MUNg==
MIME-Version 1.0
X-Received by 10.194.109.68 with SMTP id hq4mr13227994wjb.21.1400233225847; Fri, 16 May 2014 02:40:25 -0700 (PDT)
In-Reply-To <87d2fe9j53.fsf@elektro.pacujo.net>
References <mailman.9945.1399965443.18130.python-list@python.org> <a3253d6a-ef89-49d5-b866-8c06a7462219@googlegroups.com> <5373f400$0$24922$e4fe514c@dreader36.news.xs4all.nl> <600f69c8-541f-4fae-a3db-4da33b776046@googlegroups.com> <mailman.10027.1400121821.18130.python-list@python.org> <ll2c3t$89v$1@news.albasani.net> <87a9ajb36d.fsf@elektro.pacujo.net> <78ac407a-c429-4a7a-93c9-5d83e0f09cbb@googlegroups.com> <8761l7b05y.fsf@elektro.pacujo.net> <5375af57$0$29977$c3e8da3$5496439d@news.astraweb.com> <87k39m9pib.fsf@elektro.pacujo.net> <mailman.10061.1400225975.18130.python-list@python.org> <87d2fe9j53.fsf@elektro.pacujo.net>
Date Fri, 16 May 2014 19:40:25 +1000
Subject Re: PEP 8 : Maximum line Length :
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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>
Newsgroups comp.lang.python
Message-ID <mailman.10064.1400233228.18130.python-list@python.org> (permalink)
Lines 43
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1400233228 news.xs4all.nl 2966 [2001:888:2000:d::a6]:58025
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:71653

Show key headers only | View raw


On Fri, May 16, 2014 at 7:18 PM, Marko Rauhamaa <marko@pacujo.net> wrote:
> If every bit of your Python text conveys information, obviously, it
> can't be abstracted. I don't believe that to be the case, though. So
> this AST should contain all *actual* information worth conveying and
> strip away irrelevant stuff.
>
> Examples:
>
>  * Function definition order.
>
>  * Indentation depth.
>
>  * Vertical empty space.

* Logical layout as expressed by whitespace and specific line breaks.

Compare these two assignment statements:

area = (base*base + extension*extension
    + annex*annex + (annex-extension)*annex
    + triangle*triangle/2
    + circle*circle*math.PI + sphere*sphere*4*math.PI)

area = (base*base + extension*extension + annex*annex
    + (annex-extension)*annex + triangle*triangle/2
    + circle*circle*math.PI + sphere*sphere*4*math.PI)

Both are wrapped to sixty characters, which means they can be indented
twenty without breaking PEP 8. One of them takes up only three lines,
the other takes up four. But the first one groups the annex's terms,
separates out the triangle, groups the circular elements, and
presumably corresponds accurately to the (mythical) real-world
geometry that it's implementing. How are you going to cope with this
distinction? That's real, useful information, which the AST doesn't
carry.

(You might argue that each of these lines should have a comment at the
end of it or above it, which would provide that grouping. But in that
case, you lose the canonicalization of anything with trailing comments
or interspersed comments, meaning that you effectively can't reformat
anything with comments in it.)

ChrisA

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


Thread

PEP 8 : Maximum line Length : Ganesh Pal <ganesh1pal@gmail.com> - 2014-05-13 12:37 +0530
  Re: PEP 8 : Maximum line Length : Rustom Mody <rustompmody@gmail.com> - 2014-05-13 04:52 -0700
    Re: PEP 8 : Maximum line Length : Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-13 13:46 +0000
      Re: PEP 8 : Maximum line Length : Ben Finney <ben@benfinney.id.au> - 2014-05-14 08:55 +1000
        Re: PEP 8 : Maximum line Length : Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-05-14 12:24 +1200
      Re: PEP 8 : Maximum line Length : Terry Reedy <tjreedy@udel.edu> - 2014-05-14 17:09 -0400
    Re: PEP 8 : Maximum line Length : albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-05-14 22:53 +0000
      Re: PEP 8 : Maximum line Length : Gary Herron <gary.herron@islandtraining.com> - 2014-05-14 17:15 -0700
      Re: PEP 8 : Maximum line Length : Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-05-15 02:16 +0100
        Re: PEP 8 : Maximum line Length : Roy Smith <roy@panix.com> - 2014-05-14 22:12 -0400
          Re: PEP 8 : Maximum line Length : Dave Angel <davea@davea.name> - 2014-05-15 08:16 -0400
      Re: PEP 8 : Maximum line Length : Rustom Mody <rustompmody@gmail.com> - 2014-05-14 19:36 -0700
        Re: PEP 8 : Maximum line Length : Ben Finney <ben@benfinney.id.au> - 2014-05-15 12:43 +1000
          Re: PEP 8 : Maximum line Length : Johannes Bauer <dfnsonfsduifb@gmx.de> - 2014-05-15 14:32 +0200
            Re: PEP 8 : Maximum line Length : Marko Rauhamaa <marko@pacujo.net> - 2014-05-15 16:07 +0300
              Re: PEP 8 : Maximum line Length : Chris Angelico <rosuav@gmail.com> - 2014-05-15 23:31 +1000
                Re: PEP 8 : Maximum line Length : alister <alister.nospam.ware@ntlworld.com> - 2014-05-15 13:38 +0000
                Re: PEP 8 : Maximum line Length : Chris Angelico <rosuav@gmail.com> - 2014-05-15 23:44 +1000
                Re: PEP 8 : Maximum line Length : alister <alister.nospam.ware@ntlworld.com> - 2014-05-15 19:29 +0000
              Re: PEP 8 : Maximum line Length : Rustom Mody <rustompmody@gmail.com> - 2014-05-15 06:53 -0700
                Re: PEP 8 : Maximum line Length : Roy Smith <roy@panix.com> - 2014-05-15 09:58 -0400
                Re: PEP 8 : Maximum line Length : Chris Angelico <rosuav@gmail.com> - 2014-05-16 00:14 +1000
                Re: PEP 8 : Maximum line Length : Rustom Mody <rustompmody@gmail.com> - 2014-05-15 07:15 -0700
                Re: PEP 8 : Maximum line Length : Marko Rauhamaa <marko@pacujo.net> - 2014-05-15 17:29 +0300
                Re: PEP 8 : Maximum line Length : Skip Montanaro <skip@pobox.com> - 2014-05-15 09:38 -0500
                Re: PEP 8 : Maximum line Length : Chris Angelico <rosuav@gmail.com> - 2014-05-16 00:42 +1000
                Re: PEP 8 : Maximum line Length : Terry Reedy <tjreedy@udel.edu> - 2014-05-15 17:50 -0400
                Re: PEP 8 : Maximum line Length : MRAB <python@mrabarnett.plus.com> - 2014-05-16 01:05 +0100
                Re: PEP 8 : Maximum line Length : Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-05-15 17:18 +0100
                Re: PEP 8 : Maximum line Length : Marko Rauhamaa <marko@pacujo.net> - 2014-05-15 17:12 +0300
                Re: PEP 8 : Maximum line Length : Chris Angelico <rosuav@gmail.com> - 2014-05-16 00:24 +1000
                Re: PEP 8 : Maximum line Length : Marko Rauhamaa <marko@pacujo.net> - 2014-05-15 17:36 +0300
                Re: PEP 8 : Maximum line Length : Chris Angelico <rosuav@gmail.com> - 2014-05-16 01:03 +1000
                Re: PEP 8 : Maximum line Length : Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-16 06:25 +0000
                Re: PEP 8 : Maximum line Length : Ben Finney <ben@benfinney.id.au> - 2014-05-16 16:54 +1000
                Re: PEP 8 : Maximum line Length : Marko Rauhamaa <marko@pacujo.net> - 2014-05-16 10:00 +0300
                Re: PEP 8 : Maximum line Length : Chris Angelico <rosuav@gmail.com> - 2014-05-16 17:39 +1000
                Re: PEP 8 : Maximum line Length : Marko Rauhamaa <marko@pacujo.net> - 2014-05-16 12:18 +0300
                Re: PEP 8 : Maximum line Length : Chris Angelico <rosuav@gmail.com> - 2014-05-16 19:40 +1000
                Re: PEP 8 : Maximum line Length : Marko Rauhamaa <marko@pacujo.net> - 2014-05-16 13:48 +0300
                Re: PEP 8 : Maximum line Length : Chris Angelico <rosuav@gmail.com> - 2014-05-16 17:36 +1000
              Re: PEP 8 : Maximum line Length : Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-16 00:21 +0000
            Re: PEP 8 : Maximum line Length : Chris Angelico <rosuav@gmail.com> - 2014-05-15 23:27 +1000
              Re: PEP 8 : Maximum line Length : Rustom Mody <rustompmody@gmail.com> - 2014-05-15 06:58 -0700
                Re: PEP 8 : Maximum line Length : Terry Reedy <tjreedy@udel.edu> - 2014-05-15 18:21 -0400
                Re: PEP 8 : Maximum line Length : Rustom Mody <rustompmody@gmail.com> - 2014-05-15 17:06 -0700
                Re: PEP 8 : Maximum line Length : Ben Finney <ben@benfinney.id.au> - 2014-05-16 10:21 +1000
                Re: PEP 8 : Maximum line Length : Rustom Mody <rustompmody@gmail.com> - 2014-05-15 20:03 -0700
                Re: PEP 8 : Maximum line Length : Ben Finney <ben@benfinney.id.au> - 2014-05-16 16:12 +1000
                Re: PEP 8 : Maximum line Length : Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-16 07:05 +0000
                Re: PEP 8 : Maximum line Length : Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-16 02:25 +0000
            Re: PEP 8 : Maximum line Length : Ben Finney <ben@benfinney.id.au> - 2014-05-16 09:32 +1000
        Re: PEP 8 : Maximum line Length : Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-15 03:28 +0000
          Re: PEP 8 : Maximum line Length : Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-05-15 20:18 -0400
        Re: PEP 8 : Maximum line Length : Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-05-15 04:44 +0100
  Re: PEP 8 : Maximum line Length : Roy Smith <roy@panix.com> - 2014-05-13 08:09 -0400
    Re: PEP 8 : Maximum line Length : Ben Finney <ben@benfinney.id.au> - 2014-05-13 22:26 +1000
      Re: PEP 8 : Maximum line Length : Roy Smith <roy@panix.com> - 2014-05-13 20:51 -0400
    Re: PEP 8 : Maximum line Length : Tim Chase <python.list@tim.thechases.com> - 2014-05-13 07:52 -0500

csiph-web