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


Groups > comp.lang.python > #82042

Re: Tabs for indentation & Spaces for alignment in Python 3?

Return-Path <torriem+gmail@torriefamily.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'that?': 0.05; 'subject:Python': 0.06; '*not*': 0.07; 'alignment': 0.07; 'spaces': 0.09; 'python': 0.11; 'wrote': 0.14; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'indent': 0.16; 'skip:> 20': 0.16; 'tab': 0.16; 'tabs': 0.16; 'wrote:': 0.18; 'obviously': 0.18; 'properly': 0.19; 'header:User- Agent:1': 0.23; 'certainly': 0.24; 'looks': 0.24; "i've": 0.25; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'am,': 0.29; 'points': 0.29; "doesn't": 0.30; "i'm": 0.30; 'code': 0.31; 'programmers': 0.33; 'editor': 0.35; 'but': 0.35; 'really': 0.36; 'described': 0.36; 'doing': 0.36; 'subject:?': 0.36; 'behind': 0.37; 'clear': 0.37; 'message-id:@gmail.com': 0.38; 'to:addr :python-list': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'skip:u 10': 0.60; 'most': 0.60; "you're": 0.61; 'sound': 0.68; 'subject: & ': 0.68; 'together,': 0.84; 'writing,': 0.84; 'apparent': 0.91
X-Virus-Scanned amavisd-new at torriefamily.org
Date Sat, 06 Dec 2014 10:26:07 -0700
From Michael Torrie <torriem@gmail.com>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131118 Thunderbird/17.0.11
MIME-Version 1.0
To python-list@python.org
Subject Re: Tabs for indentation & Spaces for alignment in Python 3?
References <CAFaCOgzqxcvuKBrcSkK+DRm-5pHuh6QCXi1PKG4LHGqdBjLF_A@mail.gmail.com> <m5tpqg$iqi$1@ger.gmane.org> <mailman.16650.1417835105.18130.python-list@python.org> <87mw71maqu.fsf@elektro.pacujo.net> <mailman.16653.1417884132.18130.python-list@python.org> <87d27wlnr4.fsf@elektro.pacujo.net>
In-Reply-To <87d27wlnr4.fsf@elektro.pacujo.net>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
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.16655.1417886776.18130.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1417886776 news.xs4all.nl 2910 [2001:888:2000:d::a6]:45572
X-Complaints-To abuse@xs4all.nl
Path csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Xref csiph.com comp.lang.python:82042

Show key headers only | View raw


On 12/06/2014 09:57 AM, Marko Rauhamaa wrote:
>> And one of the OP's points is that by using tabs for indent, and
>> spaces for alignment, you can have the best of both worlds.
> 
> I certainly doesn't sound that way.

Why is that?

> 
>> Programmers can set their tab size to anything they want, and it still
>> looks good
> 
> That's anything but true. I see zigzaggy diffs all the time.

You're not reading what I'm writing, at least understanding it.  The
idea behind using tabs for indent and spaces for alignment are clear enough:
>------->-------blah (one,
>------->-------......two

So obviously your zigzaggy diffs are showing that the person who wrote
the code is *not* using tabs for indent and spaces for alignment.  Must
just be using tabs.  Since tabs and spaces are not visibly
distinguished, it's not readily apparent when one is properly using tabs
and spaces together, and not apparent that your editor is doing it
properly, so in Python most people recommend never mixing tabs and
spaces, although you *can* do that in the way I've described if you
really want to.

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


Thread

Re: Tabs for indentation & Spaces for alignment in Python 3? Michael Torrie <torriem@gmail.com> - 2014-12-05 20:04 -0700
  Re: Tabs for indentation & Spaces for alignment in Python 3? Marko Rauhamaa <marko@pacujo.net> - 2014-12-06 10:40 +0200
    Re: Tabs for indentation & Spaces for alignment in Python 3? Michael Torrie <torriem@gmail.com> - 2014-12-06 09:41 -0700
      Re: Tabs for indentation & Spaces for alignment in Python 3? Marko Rauhamaa <marko@pacujo.net> - 2014-12-06 18:57 +0200
        Re: Tabs for indentation & Spaces for alignment in Python 3? Michael Torrie <torriem@gmail.com> - 2014-12-06 10:26 -0700
          Re: Tabs for indentation & Spaces for alignment in Python 3? Marko Rauhamaa <marko@pacujo.net> - 2014-12-06 22:04 +0200
    Re: Tabs for indentation & Spaces for alignment in Python 3? Chris Angelico <rosuav@gmail.com> - 2014-12-07 03:46 +1100

csiph-web