Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.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.042 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.02; 'syntax': 0.04; 'anyway.': 0.05; 'subject:PEP': 0.07; 'appropriate.': 0.09; 'python': 0.11; "'break'": 0.16; '(note:': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'jumping': 0.16; 'loops': 0.16; 'wrote:': 0.18; '(the': 0.22; 'header:In-Reply-To:1': 0.27; 'specifically': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; '25,': 0.31; 'breaking': 0.31; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'earth': 0.36; 'should': 0.36; 'step': 0.37; 'being': 0.38; 'to:addr :python-list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'middle': 0.60; 'subject:? ': 0.60; 'teach': 0.65; 'subject:this': 0.83; 'why?': 0.91; 'interrupted': 0.96; 'taught': 0.96; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=FOGOvpKYGHEKu55S164/USMFBDKJCsHtIHZrzCujZK8=; b=L29W1p4J4RIKWGkhZov4GQsbA9JvBWFk1UQhNnwcu5a1u+lfTAPrn0q2E4tlNl58Dl UzisNtVb1Xp7q/+YKfQrFq1MqGFrlqyU0D2FD5HCBUQu/JeYtCSNnZdeO25vh8AK5w71 ujpP048Gzfd8s+kbuEGADvlvxfFc10DhW3LrwgnYWIC70Y6T6lUXZYUfQms9qYXvGWVo Dw1eNlodUKyORRtloiC/hsJUIgZaes6/uZiWvhY2ItKrL3EzIGzmuLRdHOzev1Rf8dxJ 14dIQq0Dpn7D7eQHYTQukU5gcEo1vCGETEUwY1EqATw2BuFyzfZczgt8NJDiAT7XvyxL jLbQ== MIME-Version: 1.0 X-Received: by 10.58.249.173 with SMTP id yv13mr2368024vec.98.1372109937321; Mon, 24 Jun 2013 14:38:57 -0700 (PDT) In-Reply-To: <8D03F2B8CF0E7BE-1864-1796B@webmail-m103.sysops.aol.com> References: <8D03F2B8CF0E7BE-1864-1796B@webmail-m103.sysops.aol.com> Date: Tue, 25 Jun 2013 07:38:57 +1000 Subject: Re: Is this PEP-able? fwhile From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1372110329 news.xs4all.nl 15991 [2001:888:2000:d::a6]:46636 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:49092 On Tue, Jun 25, 2013 at 5:52 AM, wrote: > (NOTE: Many people are being taught to avoid 'break' and 'continue' at all > costs... Why? Why on earth should break/continue be avoided? I think that's the solution: teach people that loops are there to be interrupted and manipulated. And then it's a small step to jumping into the middle of a loop, and from there to Duff's Device... hmm, I'm not sure that strengthens my case, really. But anyway. Python has no issues with breaking out of loops, and even has syntax specifically to complement it (the 'else:' clause). Use break/continue when appropriate. ChrisA