Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4.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.072 X-Spam-Evidence: '*H*': 0.86; '*S*': 0.00; '"this': 0.03; 'received:134': 0.05; 'subject:Python': 0.06; 'python': 0.11; '"if"': 0.16; 'true:': 0.16; 'wrote:': 0.18; 'otherwise,': 0.22; 'preferred': 0.22; 'header:User-Agent:1': 0.23; 'fine': 0.24; 'regardless': 0.24; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'chris': 0.29; "doesn't": 0.30; 'label': 0.30; "i'm": 0.30; 'code': 0.31; 'argue': 0.31; 'forces': 0.31; 'languages': 0.32; 'maybe': 0.34; 'could': 0.34; 'subject: (': 0.35; "can't": 0.35; 'something': 0.35; 'but': 0.35; 'really': 0.36; 'half': 0.37; 'subject:New': 0.37; 'represent': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'bad': 0.39; 'structure': 0.39; 'support,': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'middle': 0.60; 'most': 0.60; 'break': 0.61; 'more': 0.64; 'line,': 0.68; 'physical': 0.72; 'goto': 0.84; 'instantly': 0.84; 'pardon': 0.84; 'protest': 0.84 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqcEAHa+L1WGuA9G/2dsb2JhbABch0/HaIJcAoIQAQEBAQEBhR8BAQQjVRELGAICBRYLAgIJAwIBAgFFEwgCiCayA5B6hHQBAQgCIIEhigqFAxaCUoFFAQSbL4EdhW+KIoNNIoNxgzABAQE Date: Thu, 16 Apr 2015 15:57:41 +0200 From: Antoon Pardon User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.5.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: New to Python - block grouping (spaces) References: <9fc57fc9-0399-4ff3-882a-d041f02827d8@googlegroups.com> <552F772B.8030201@rece.vub.ac.be> <552f9264$0$11092$c3e8da3@news.astraweb.com> <552F97EA.5080401@rece.vub.ac.be> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20 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: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1429192662 news.xs4all.nl 2905 [2001:888:2000:d::a6]:56502 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:89027 On 04/16/2015 03:41 PM, Chris Angelico wrote: > The case of a loop structure with its condition in the middle is one > that few languages support, so the physical structure has to be > something like: > > goto middle > while not condition: > more code > label middle > some code > > or > > while True: > some code > if condition: break > more code > > or maybe > > some code > while not condition: > more code > some code > > But I'm not sure how you could represent this more appropriately, > regardless of your indentation. Unindenting an "if" in the middle of a > loop doesn't instantly scream "this is the loop header". Using a goto > to jump half way into a loop is a really REALLY bad idea in most > programs (and it's illegal in lots of languages anyway). Repeating the > setup code is fine if it's a single line, but not else. > I'm not going to argue the merrits of various indentations styles. I just wanted to protest the notion, that because one indents one's programs in languages that don't require indentations, one can't have a quarrel with how python forces you to indent. A choice was made and although I would have preferred otherwise, I can live with it. -- Antoon Pardon