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


Groups > comp.lang.python > #51824

Re: PEP8 revised: max line lengths

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.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.011
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; ';-)': 0.03; 'column': 0.07; 'correct.': 0.07; 'assuming': 0.09; 'counting': 0.09; 'expected.': 0.09; 'pixel': 0.09; 'solution,': 0.09; 'width': 0.09; 'python': 0.11; 'arithmetic.': 0.16; 'columns': 0.16; 'compliant,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hint:': 0.16; 'left:': 0.16; 'printing.': 0.16; 'screen,': 0.16; '\xe9crit': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'obviously': 0.18; 'possible,': 0.19; '(in': 0.22; 'aug': 0.22; 'print': 0.22; 'either.': 0.24; 'enhanced': 0.24; 'instance,': 0.24; 'mind.': 0.24; 'skip': 0.24; 'unicode': 0.24; 'define': 0.26; 'primary': 0.26; 'certain': 0.27; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'correct': 0.29; '[1]': 0.29; 'character': 0.29; 'points': 0.29; 'characters': 0.30; 'message- id:@mail.gmail.com': 0.30; 'work.': 0.31; '(which': 0.31; 'code': 0.31; 'url:wiki': 0.31; 'constant': 0.31; 'font': 0.31; 'url:wikipedia': 0.31; 'yourself.': 0.31; 'supposed': 0.32; 'fri,': 0.33; 'screen': 0.34; 'sense': 0.34; 'could': 0.34; 'problem': 0.35; 'tool': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'right?': 0.36; 'url:org': 0.36; 'unit': 0.37; 'so,': 0.37; 'two': 0.37; 'requiring': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'pdf': 0.39; 'to:addr:python.org': 0.39; 'units': 0.60; 'length': 0.61; 'guarantee': 0.63; 'charset:windows-1252': 0.65; 'compliant': 0.68; 'physical': 0.72; 'viewed': 0.74; '*and*': 0.84; 'bitmap': 0.84; 'comment.': 0.84; 'equation,': 0.84; 'pdf.': 0.84; 'sixth': 0.84; 'absolutely': 0.87; 'accepted)': 0.91; 'mistake': 0.91; 'this;': 0.91; 'wish,': 0.91; 'serious': 0.97; '2013': 0.98
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:to :content-type:content-transfer-encoding; bh=2zRmC25OTEeQzJI4H2/WyoVi7M/bQS+KIw3hWx4FpGY=; b=mjxu/q70qkRrIUff6+GM9dDxqc1gkzdIM9PfHwiRw2DhuK3ZawyB6P4ctDmx6TsWCU vvYGRQE/DpmGrAnSMeW+gcE/YmrQ9rh1S8N+GUCfgF+orqYwLnt4U0gDtr6g3njBUHvn B1zQLCeA+YNLDP5zvPjmHY2n0fYOsmbyt74jXIIos/baRgZ57s8883AAgM685QJWr6m+ 8yoQYSIm44lb75mr91rNKUqCFn5s4jDuJvrOnKOjgr/l3Q9AxzC6sbEKYrWGC848+rHl l0IDrolLzhUL9a+Pkg/8a9WIY9STs/MUov/W769j/kIQI/BEIKMXDYK+VuGiB2ueCYWv 6eCA==
MIME-Version 1.0
X-Received by 10.52.65.241 with SMTP id a17mr2232523vdt.23.1375479254075; Fri, 02 Aug 2013 14:34:14 -0700 (PDT)
In-Reply-To <8b60088c-941a-46e5-9aab-629b082ef45b@googlegroups.com>
References <mailman.93.1375386763.1251.python-list@python.org> <roy-C1BE66.20514301082013@news.panix.com> <mailman.112.1375441669.1251.python-list@python.org> <69cdc3df-475f-472c-a163-f3b85f806ff6@googlegroups.com> <mailman.129.1375456754.1251.python-list@python.org> <8b60088c-941a-46e5-9aab-629b082ef45b@googlegroups.com>
Date Fri, 2 Aug 2013 22:34:13 +0100
Subject Re: PEP8 revised: max line lengths
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding quoted-printable
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.132.1375479257.1251.python-list@python.org> (permalink)
Lines 54
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1375479257 news.xs4all.nl 15941 [2001:888:2000:d::a6]:59049
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:51824

Show key headers only | View raw


On Fri, Aug 2, 2013 at 10:15 PM,  <wxjmfauth@gmail.com> wrote:
> Le vendredi 2 août 2013 17:19:11 UTC+2, Skip Montanaro a écrit :
>> > The solely valid solution, assuming there is some wish,
>> > is to define a maximal line width (preferably in SI units ;-)
>>
>> So, 79 * 8 points == 0.222955555696 meters, right? :-)
>>
>> Skip
>
> You can correct your mistake yourself. In your
> equation, the unit at the left is [1] * [point] = [point],
> at the right the unit is [meter], obviously
> [point] != [meter].

http://en.wikipedia.org/wiki/Point_(typography)

A point is one twelfth of a pica, which is one sixth of an inch, which
is 0.0254 SI millimeters. Do the arithmetic. Skip is absolutely
correct.

> Problem #1
> For a tool which is supposed to be Unicode compliant,
> a Unicode compliant font has never a constant pitch,
> so counting a maximal width in number of characters
> does not make sense.
>
> Problem #2
> The only valid constraint which makes sense is
> a maximal size in a length unit. Two possibilities:
> – if you consider your document is to be viewed
> as a screen document, pixel comes in mind.
> – if you condider your document will be printed,
> retain a physical unit length (cm, inch).
>
> Problem #3
> cm or inch? The only serious unit is an SI unit.
> (In scientific publications, only SI units are accepted)

The cm is not a primary SI unit either.

> Hint: Put you code in a pdf.

Hint: Put your code in a bitmap for screens *and* a PDF for printing.
That's the only way to guarantee that it'll work.

Since this is not possible, there is one solution left: Do not view
your code on screen, but only print it out. Then you can guarantee
that your columns are as you expected. Python could be enhanced to
take advantage of this; for instance, instead of requiring the hash
character (which may be difficult to type on certain keyboards,
including mobile phones), a letter C (U+0043) in column 1 can cause
the line to be considered a Comment.

ChrisA

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


Thread

PEP8 revised: max line lengths Terry Reedy <tjreedy@udel.edu> - 2013-08-01 15:52 -0400
  Re: PEP8 revised: max line lengths Roy Smith <roy@panix.com> - 2013-08-01 20:51 -0400
    Re: PEP8 revised: max line lengths Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-02 04:28 +0000
    Re: PEP8 revised: max line lengths Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-08-02 13:07 +0200
      Re: PEP8 revised: max line lengths wxjmfauth@gmail.com - 2013-08-02 08:08 -0700
        Re: PEP8 revised: max line lengths Skip Montanaro <skip@pobox.com> - 2013-08-02 10:19 -0500
          Re: PEP8 revised: max line lengths wxjmfauth@gmail.com - 2013-08-02 14:15 -0700
            Re: PEP8 revised: max line lengths Chris Angelico <rosuav@gmail.com> - 2013-08-02 22:34 +0100
            Re: PEP8 revised: max line lengths Joshua Landau <joshua@landau.ws> - 2013-08-03 03:21 +0100
            Re: PEP8 revised: max line lengths Chris Angelico <rosuav@gmail.com> - 2013-08-03 07:43 +0100
              Re: PEP8 revised: max line lengths Roy Smith <roy@panix.com> - 2013-08-03 11:00 -0400
                Re: PEP8 revised: max line lengths wxjmfauth@gmail.com - 2013-08-03 10:21 -0700
    Re: PEP8 revised: max line lengths Nicholas Cole <nicholas.cole@gmail.com> - 2013-08-03 12:35 +0100
      Re: PEP8 revised: max line lengths wxjmfauth@gmail.com - 2013-08-04 02:52 -0700
        Re: PEP8 revised: max line lengths Roy Smith <roy@panix.com> - 2013-08-04 10:07 -0400
          Re: PEP8 revised: max line lengths Sergi Pasoev <s.pasoev@gmail.com> - 2013-08-04 18:20 +0400
          Re: PEP8 revised: max line lengths Sergi Pasoev <s.pasoev@gmail.com> - 2013-08-04 18:27 +0400
          Re: PEP8 revised: max line lengths Chris Angelico <rosuav@gmail.com> - 2013-08-04 15:18 +0100
            Re: PEP8 revised: max line lengths Roy Smith <roy@panix.com> - 2013-08-04 14:18 -0400
              Re: PEP8 revised: max line lengths Chris Angelico <rosuav@gmail.com> - 2013-08-04 19:23 +0100

csiph-web