Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'configure': 0.05; 'subject:Python': 0.06; 'continuation': 0.07; 'diff': 0.07; 'differing': 0.09; 'etc).': 0.09; 'lines.': 0.09; 'pep': 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; 'whole.': 0.09; 'width': 0.09; 'python': 0.11; '...because': 0.16; 'better?': 0.16; 'decision,': 0.16; 'editor,': 0.16; 'hint': 0.16; 'indent': 0.16; 'innovate': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'tab': 0.16; 'tabs': 0.16; 'whatsoever': 0.16; 'wrote:': 0.18; 'things.': 0.19; 'programming': 0.22; 'preferred': 0.22; 'header:User-Agent:1': 0.23; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'feature': 0.29; 'character': 0.29; 'bigger': 0.30; 'nature': 0.30; 'strongly': 0.30; 'code': 0.31; "user's": 0.31; 'probably': 0.32; 'another': 0.32; '(i.e.': 0.33; 'development.': 0.33; 'core': 0.34; "can't": 0.35; 'agree': 0.35; 'but': 0.35; 'there': 0.35; 'really': 0.36; 'done': 0.36; 'subject:?': 0.36; 'two': 0.37; 'system,': 0.38; 'displays': 0.38; 'initially': 0.38; 'question,': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; "couldn't": 0.39; 'itself': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'according': 0.40; 'how': 0.40; 'read': 0.60; 'affect': 0.61; 'mentioned': 0.61; 'kindly': 0.61; 'places': 0.64; 'debate': 0.68; 'feeling': 0.68; 'subject: & ': 0.68; 'caused': 0.69; 'online': 0.71; '(printing,': 0.84; 'etc,': 0.84; 'krish': 0.84; 'mr.': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ned Batchelder Subject: Re: Tabs for indentation & Spaces for alignment in Python 3? Date: Fri, 05 Dec 2014 16:05:36 -0500 References: 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: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1417813554 news.xs4all.nl 2888 [2001:888:2000:d::a6]:33063 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:82022 On 12/5/14 12:40 PM, Aahan Krish wrote: > I have two general questions regarding Python that I couldn't find any > good answers for. This is not the often-asked Tabs vs Spaces question, > so kindly read it in whole. > > *Q1.* This is not to debate the decision, but I really wanted to know > the reason why PEP 8 chose to go with spaces instead of tabs. I read > that tabs were initially preferred over spaces (esp. Mr. Rossum)? What > caused the decision that spaces are better? > > According to Core Python Programming (Book): > > ...because tabs vary in the number of spaces depending on your > system, we recommend not using tabs if there is any hint of > cross-platform development. > > > Isn't that a feature of tabs? (i.e. allowing the user to configure the > size of a tab stop in his editor, which has no affect whatsoever on the > tab character itself or how it displays in another user's editor.) But you can't configure the width of tabs in all the places you look at code (printing, online repos, diff viewers, etc, etc). Others have mentioned the awkward nature of over-indented continuation lines. My feeling is that if you are working with others who feel strongly enough about differing indent widths that they need to use tabs so they can each have their own way, then you probably have bigger collaboration issues. Use four spaces, and be done with it. Agree with your team members on how your code will look, then innovate on the important things. -- Ned Batchelder, http://nedbatchelder.com