Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'programmer': 0.03; 'subject:Python': 0.06; 'differently.': 0.09; 'skip:> 40': 0.09; 'spaces': 0.09; 'arbitrarily': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'mode,': 0.16; 'skip:> 50': 0.16; 'tab': 0.16; 'tabs': 0.16; 'wrote:': 0.18; 'header:User- Agent:1': 0.23; 'mind.': 0.24; 'least': 0.26; 'header:In-Reply- To:1': 0.27; 'skip:( 20': 0.30; 'code': 0.31; 'that.': 0.31; 'struct': 0.31; 'programmers': 0.33; 'maybe': 0.34; 'could': 0.34; 'display': 0.35; 'knows': 0.35; 'editor': 0.35; 'but': 0.35; 'c++': 0.36; 'skip:> 10': 0.36; 'subject:?': 0.36; 'message- id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'fact': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'course': 0.61; 'subject: & ': 0.68; 'batchelder': 0.84; 'do:': 0.91 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Fri, 05 Dec 2014 20:04:48 -0700 From: Michael Torrie 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: In-Reply-To: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1417835105 news.xs4all.nl 2920 [2001:888:2000:d::a6]:48999 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:82034 On 12/05/2014 07:31 PM, Ned Batchelder wrote: > This is a perfect example! The code (with tabs as >--- and leading > spaces as .) is: > > >-------if (!list_empty(pending)) > >------->-------ret = list_first_entry(pending, struct async_entry, > >------->------->------->-------.......domain_list)->cookie; > > Now, display it in your editor with tabs set to four spaces: > > >---if (!list_empty(pending)) > >--->---ret = list_first_entry(pending, struct async_entry, > >--->--->--->---.......domain_list)->cookie; However, a conscientious programmer knows that tabs could be arbitrarily sized, so he would never do that. Instead he would do: >-------if (!list_empty(pending)) >------->-------ret = list_first_entry(pending, struct async_entry, >------->-------.......................domain_list)->cookie; Which under the heretical tab size of 4: >---if (!list_empty(pending)) >--->---ret = list_first_entry(pending, struct async_entry, >--->---.......................domain_list)->cookie; In fact a decent editor that is auto-indenting code would, at least in C or C++ mode, do that automatically. Maybe I misread, but I would think this is what the OP had in mind. Of course maybe kernel programmers think differently. Ahh well.