Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Sven R. Kunze" Newsgroups: comp.lang.python Subject: Re: empty clause of for loops Date: Wed, 16 Mar 2016 16:17:17 +0100 Lines: 29 Message-ID: References: <56E93413.6090108@mail.de> <56E94EB9.9050507@mail.de> <56E96DDA.30008@mail.de> <20160316100229.0ce28992@bigbox.christie.dr> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de oaYMgGJdMZjiMidTlchFeQcehioPkd7QhcQywummVSfQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'clause': 0.07; 'executed': 0.07; 'cc:addr:python-list': 0.09; 'called.': 0.09; 'loop.': 0.09; 'to:addr:python.list': 0.09; 'to:addr:tim.thechases.com': 0.09; 'to:name:tim chase': 0.09; '"break"': 0.16; 'certainly.': 0.16; 'clause,': 0.16; 'loops': 0.16; 'mine.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; ';-)': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'fairly': 0.22; 'cc:no real name:2**0': 0.22; 'fit': 0.23; "python's": 0.23; 'tim': 0.24; 'header:In-Reply-To:1': 0.24; 'this.': 0.28; 'chase': 0.29; 'there.': 0.30; 'that.': 0.30; 'languages': 0.34; 'received:10.0': 0.34; 'best,': 0.35; 'could': 0.35; 'but': 0.36; 'skip:{ 10': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'being': 0.37; 'thought': 0.37; 'why': 0.39; 'whatever': 0.39; 'does': 0.39; 'rather': 0.39; 'received:de': 0.40; 'behavior': 0.61; 'charset:windows-1252': 0.62; 'lack': 0.76; 'disappointed': 0.84; 'miffed': 0.84; 'imagine': 0.96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mail201212; t=1458141438; bh=hGRfjlmVRwvmNL2CoXvOZcbGhXtSrBa1cxdel5xIp08=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From; b=trF7qAEpGzwOXAZnAFp0agJJrQaBiQ1EETnFEq3ECtXJio0QIZz+moLbF2F1RbWc4 sRldsK1OCIdSP5XWAomJwZGgZ8GUdueRK8vfoxYFFq2e5Sb8xQlOTvhchtInUFNxud DXcjfNm05diJ0j+YM3SeOM8KVYXEbRDyT6VKQ2dA= In-Reply-To: <20160316100229.0ce28992@bigbox.christie.dr> X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 1018 X-purgate-ID: 154282::1458141437-00004575-7FEF3A0E/0/0 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105047 On 16.03.2016 16:02, Tim Chase wrote: > On 2016-03-16 15:29, Sven R. Kunze wrote: >> I would re-use the "for-else" for this. Everything I thought I >> could make use of the "-else" clause, I was disappointed I couldn't. > Hmm...this must be a mind-set thing. I use the "else" clause with > for/while loops fairly regularly and would be miffed if their behavior > changed. > > Could I work around their absence? Certainly. > > Does it annoy me when I have to work in other languages that lack > Python's {for/while}/else functionality? You bet. I can imagine that. Could you describe the general use-case? From what I know, "else" is executed when you don't "break" the loop. When is this useful? Btw., I don't have any issue with else or whatever it is called. It's just a word but it must fit intuition. And this is why I would rather see "else" being used there. But this may result because of the lack of usage of mine. We can also re-use "except" for it. ;-) Best, Sven