Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2a.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.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'else:': 0.03; 'broken': 0.04; 'subject:Python': 0.06; 'function,': 0.09; 'indication': 0.09; 'python': 0.11; 'agree.': 0.16; 'interpreter,': 0.16; 'rarely': 0.16; 'reedy': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'print': 0.22; 'parse': 0.24; '15,': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'chris': 0.29; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'lines': 0.31; 'usually': 0.31; 'up.': 0.33; 'received:google.com': 0.35; 'there': 0.35; 'functions.': 0.36; 'should': 0.36; 'auto': 0.38; 'e.g.': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'easy': 0.60; 'blank': 0.60; 'such': 0.63; 'skip:\xe2 10': 0.65; 'within': 0.65; 'subject:there': 0.68; 'sharing': 0.69; '8bit%:43': 0.74; '10:32': 0.84; 'hardly': 0.84; 'why?': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=TcmnQ6LntsOT0xhx0kSjUs7N0JkZFnu8D9kiRmbcBEU=; b=ds857thNNAvaMXWFIQX5PF1cCkmLUZoFebCPpfH+LmPakX+iOS7SC5anhxHcN0i55t Cqkv0G77ET//AvqyOGdVjMAZAcJSOe8si7IqZlZDhbb1Et5CTa9IDvQfAxj84AWzB5vt o2MRgi4tKc/96K/ogIMzEYiltQx707IoOIwGprLJ91gAZmGVdO6ZEGKiaCZltZAHelPu i4tU27TlVSwXxNg3etZJSjuT4AEzpKhf4Neby2MMtUkTvrQmmr+kGAIFehKWATKRVh0J RMEgb0V3e0Qb0/W0o/VlTckXaLOmxtvDHzWMpIw53kpgiTuXSUAAmd3rwp3+DeavYREy Lqww== X-Received: by 10.68.102.1 with SMTP id fk1mr5015329pbb.147.1413401458083; Wed, 15 Oct 2014 12:30:58 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <9a0c67be-de3a-4770-bf06-e158783bfff0@googlegroups.com> From: Ian Kelly Date: Wed, 15 Oct 2014 13:30:17 -0600 Subject: Re: Is there an easy way to control indents in Python To: Python Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1413401464 news.xs4all.nl 2859 [2001:888:2000:d::a6]:39148 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79174 On Wed, Oct 15, 2014 at 11:12 AM, Terry Reedy wrote: > On 10/15/2014 10:32 AM, Chris =E2=80=9CKwpolska=E2=80=9D Warrick wrote: >> It should parse this as >> >> else: >> print 'false' >> print 'done' >> >> Why? Because things like `print 'done'` usually have an empty line befo= re >> it: > > > There is no such rule in Python so it hardly dependable for auto indentin= g. I agree. I very rarely use blank lines inside functions. As I see it, if you feel you need a blank line for separation within a function, that's an indication your function is overly complex and should be broken up. Keeping blank lines out of functions also makes it easy to copy/paste those functions into the interactive interpreter, which can be handy e.g. when sharing snippets of code by email.