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


Groups > comp.lang.python > #74146

Re: PEP8 and 4 spaces

From Ben Finney <ben@benfinney.id.au>
Subject Re: PEP8 and 4 spaces
Date 2014-07-08 11:22 +1000
References <53B59358.2040404@tobiah.org> <CAGGBd_rOg+EX1OxryW9-6+2b6yqzzKL9xN1K7+TPSP77tJz=bQ@mail.gmail.com> <mailman.11567.1404694875.18130.python-list@python.org> <lpdbjc$qf7$1@dont-email.me>
Newsgroups comp.lang.python
Message-ID <mailman.11614.1404782560.18130.python-list@python.org> (permalink)

Show all headers | View raw


Dan Sommers <dan@tombstonezero.net> writes:

> On Mon, 07 Jul 2014 11:00:59 +1000, Ben Finney wrote:
>
> > […] a poor design decision (a line beginning with U+0020 SPACE is
> > semantically different from a line beginning with U+0009 CHARACTER
> > TABULATION) can be irrevocable – the syntax can't be changed now,
> > without breaking compatibility for countless makefiles out there
> > already – and cause endless confusion and wasted effort dealing with
> > it.
>
> When makefile syntax came into being, there were ASCII TAB characters,
> with a value of 9, and ASCII SPC characters, with a value of 32 (and
> there may not even have been those).

A group of (a particular amount of) U+0020 characters is visually
indistinguishable from a U+0009 character, when the default semantics
are applied to each.

> The former is a "control" character, which has specific semantics
> associated with it; the latter is a "printable" character, which is
> usually printed and interpreted as itself (although in this particular
> case, the printed representation is hard to see on most output
> devices).

And those specific semantics make the display of those characters easily
confused. That is why it's generally a bad idea to use U+0009 in text
edited by humans.

> This mailing list doesn't seem to mind that lines beginning with ASCII
> SPC characters are semantically different from lines beginning with
> ASCII LF characters, although many detractors of Python seem unduly
> fixated on it.

The salient difference being that U+000A LINE FEED is easily visually
distinguished from a short sequence of U+0020 SPACE characters. This
avoids the confusion, and makes use of both together unproblematic.

-- 
 \       “Come on Milhouse, there’s no such thing as a soul! It’s just |
  `\      something they made up to scare kids, like the Boogie Man or |
_o__)                          Michael Jackson.” —Bart, _The Simpsons_ |
Ben Finney

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


Thread

Re: PEP8 and 4 spaces Ben Finney <ben@benfinney.id.au> - 2014-07-07 11:00 +1000
  Re: PEP8 and 4 spaces Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-07 02:28 +0000
    Re: PEP8 and 4 spaces Chris Angelico <rosuav@gmail.com> - 2014-07-07 12:50 +1000
  Re: PEP8 and 4 spaces Dan Sommers <dan@tombstonezero.net> - 2014-07-07 05:35 +0000
    Re: PEP8 and 4 spaces Ben Finney <ben@benfinney.id.au> - 2014-07-08 11:22 +1000
      Re: PEP8 and 4 spaces wxjmfauth@gmail.com - 2014-07-08 00:03 -0700
      Re: PEP8 and 4 spaces Steven D'Aprano <steve@pearwood.info> - 2014-07-08 08:48 +0000
        Re: PEP8 and 4 spaces Chris Angelico <rosuav@gmail.com> - 2014-07-08 19:05 +1000
        Re: PEP8 and 4 spaces Marko Rauhamaa <marko@pacujo.net> - 2014-07-08 12:09 +0300
          Re: PEP8 and 4 spaces Chris Angelico <rosuav@gmail.com> - 2014-07-08 20:28 +1000
            Re: PEP8 and 4 spaces Marko Rauhamaa <marko@pacujo.net> - 2014-07-08 14:13 +0300
              Re: PEP8 and 4 spaces Chris Angelico <rosuav@gmail.com> - 2014-07-08 21:37 +1000
        Re: PEP8 and 4 spaces Ben Finney <ben@benfinney.id.au> - 2014-07-09 12:41 +1000
          Re: PEP8 and 4 spaces wxjmfauth@gmail.com - 2014-07-09 01:19 -0700

csiph-web