Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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; 'else:': 0.03; 'raised': 0.07; 'python': 0.08; 'am,': 0.13; 'wrote:': 0.15; 'indent': 0.16; 'mean,': 0.16; 'cc:addr:python-list': 0.16; 'def': 0.16; 'cc:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'indentation': 0.23; 'right.': 0.28; 'message-id:@mail.gmail.com': 0.28; 'cc:addr:python.org': 0.30; 'sun,': 0.30; "skip:' 10": 0.32; 'andrew': 0.32; 'initial': 0.33; '17,': 0.35; 'received:google.com': 0.38; 'received:209.85.161': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'received:209': 0.40; 'subject:have': 0.74; 'subject:should': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=H0ilNdVFXD2VABYzW3ToXLdAa6hHcD3hiaN137ukbb8=; b=w1diWybXg+s5IxZh8H+C0/sDxCKHN86e9X2hl/dwue9xCNDZF7dWWsuyBdQmcmoBr+ BquW+FaEQFAkI2HSS8GuKtcXPgmgdjLjshWQZScWJf/ETJ8cbJV2qyuGafhA6qqwidGx nLnVD26cVik/dllVEbaz39uXkLCH51Jv5g8w0= MIME-Version: 1.0 In-Reply-To: <4E228F43.9000405@gmail.com> References: <4E228F43.9000405@gmail.com> From: Ian Kelly Date: Sun, 17 Jul 2011 01:39:48 -0600 Subject: Re: Tabs -vs- Spaces: Tabs should have won. To: Andrew Berg Content-Type: text/plain; charset=ISO-8859-1 Cc: "comp.lang.python" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310888420 news.xs4all.nl 23911 [2001:888:2000:d::a6]:52245 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9679 On Sun, Jul 17, 2011 at 1:29 AM, Andrew Berg wrote: > You're right. TabError is only raised if the initial indentation is > inconsistent. > Not legal: > def spam(): > print('Wonderful spam!\n') > <4 spaces>print('Bloody Vikings!') > > Legal: > def eggs(): > print( > 'Blech!\n','Whaddya mean, "blech"?\n', > 'I don\'t like spam!\n','...' > ) Even this is legal: def eggs() if spam: print("Spam and eggs") else: print("Just eggs") It's only when you're inconsistent about the added indent of a single block that Python will complain.