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


Groups > comp.lang.python > #82023

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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'syntax': 0.04; 'subject:Python': 0.06; 'mixed': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'spaces': 0.09; 'width': 0.09; 'python': 0.11; "wouldn't": 0.14; 'indent': 0.16; 'nightmare.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'tab,': 0.16; 'tabs': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'saying': 0.22; 'header:User-Agent:1': 0.23; 'header:X-Complaints- To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'mix': 0.30; 'code': 0.31; 'that.': 0.31; '(used': 0.31; 'not.': 0.33; 'but': 0.35; 'subject:?': 0.36; 'so,': 0.37; 'depends': 0.38; 'to:addr:python- list': 0.38; 'skip:- 10': 0.38; 'fact': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'hope': 0.61; 'sincerely': 0.63; 'here': 0.66; 'where:': 0.68; 'subject: & ': 0.68; '--->': 0.84; 'ian,': 0.84; 'krish': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Ned Batchelder <ned@nedbatchelder.com>
Subject Re: Tabs for indentation & Spaces for alignment in Python 3?
Date Fri, 05 Dec 2014 16:34:07 -0500
References <CAFaCOgxQvq0TmS7G3f_bZ8HV+eUGSh5DSZiGxi7KhL_Yfp6Zdg@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host dhcp-18-111-31-43.dyn.mit.edu
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
In-Reply-To <CAFaCOgxQvq0TmS7G3f_bZ8HV+eUGSh5DSZiGxi7KhL_Yfp6Zdg@mail.gmail.com>
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.16641.1417815258.18130.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1417815258 news.xs4all.nl 2937 [2001:888:2000:d::a6]:43469
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:82023

Show key headers only | View raw


On 12/5/14 1:49 PM, Aahan Krish wrote:
> Hello Ian,
>
> So, wrt Q2, what you are saying is, the following would cause issues in
> Python 3?
>
>      int f(int x,
>      ......int y) {
>      --->return g(x,
>      --->.........y);
>      }
>
> Where:
>
> ---> for tabs (used for indentation)
> .... for spaces (used for alignment)

(Aside from the fact that that isn't Python syntax *at all*), Python 3 
would be OK with that indentation. It wouldn't be OK with mixed tabs and 
spaces where the meaning depends on the indent width of a tab, but here 
it does not.

I sincerely hope no one is seriously considering trying to maintain code 
using a mix of tabs and spaces like that.  That's a nightmare.

-- 
Ned Batchelder, http://nedbatchelder.com

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


Thread

Re: Tabs for indentation & Spaces for alignment in Python 3? Ned Batchelder <ned@nedbatchelder.com> - 2014-12-05 16:34 -0500

csiph-web