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


Groups > comp.lang.python > #51824

Re: PEP8 revised: max line lengths

References (1 earlier) <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 2013-08-02 22:34 +0100
Subject Re: PEP8 revised: max line lengths
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.132.1375479257.1251.python-list@python.org> (permalink)

Show all headers | 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