Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'clause': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; '~ethan~': 0.09; 'python': 0.11; '10:17': 0.16; 'tends': 0.16; 'tripped': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'instead.': 0.24; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'but': 0.35; "didn't": 0.36; 'charset:us-ascii': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'exposure': 0.60; 'ian': 0.60; 'worry': 0.60; 'received:173': 0.61; 'relatively': 0.65 Date: Fri, 05 Sep 2014 11:41:23 -0700 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: My backwards logic References: <1enj0att6bkrnvb81rhma5dbuk3h28agl8@4ax.com> <5409EE02.7030308@stoneleaf.us> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1409942486 news.xs4all.nl 2840 [2001:888:2000:d::a6]:55253 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77607 On 09/05/2014 10:17 AM, Ian Kelly wrote: > > I would not worry about the else clause as a beginner, as it's > relatively unique to Python and tends to be somewhat confusing. Use a > flag or refactor the function instead. I don't disagree with this, but early exposure to "for..else is for search loops" is a good thing. I still get tripped up by this as I didn't learn it that way. -- ~Ethan~