Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.031 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'subject:PEP': 0.07; 'exit': 0.09; 'function,': 0.09; 'imho.': 0.09; 'received:209.85.219': 0.09; "'break'": 0.16; '(note:': 0.16; '24,': 0.16; 'exceptions,': 0.16; 'ignored,': 0.16; 'reviewers': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'pointed': 0.19; '>>>': 0.22; 'programming': 0.22; 'to:name:python-list@python.org': 0.22; 'mon,': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'chris': 0.29; 'am,': 0.29; 'originally': 0.30; 'message- id:@mail.gmail.com': 0.30; '(which': 0.31; 'code': 0.31; 'easier': 0.31; '25,': 0.31; 'continues': 0.31; 'received:209.85': 0.35; 'received:google.com': 0.35; 'earth': 0.36; "didn't": 0.36; 'should': 0.36; 'received:209': 0.37; 'being': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; 'subject:? ': 0.60; "you've": 0.63; 'subject:this': 0.83; '"best': 0.84; 'promptly': 0.84; 'rusi': 0.91; 'why?': 0.91; 'taught': 0.96; '2013': 0.98 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=CpBUedBLl4En4wwHK3IGr1aRtUj8qm5C2rw3AAtU1XU=; b=Uzx13dFxgL2GUD01rK0xutNCMLJcv0aVWjT4uWtOmnKhbcpddE4RLa8PeVoHwSqMj6 XqCP12Hwxgb706+hxAEJfKbUj3r4oPbs3R5GFS1t7aq4YOFDEadM6t58M8RRPUDf3uXy Thg0czhBYEfH0oSZhG076Wf0DzOm6ctyCfDn/e9T5LgWcG5Z7PjhcvTV6Z5I3HhDxqYe zWmXF9VsQ/6LRoq74turYAQdrOfvAqoVMiyhUS8waIT2ifGEGXq3T5b2rZcA31OGP1Sh k2bzokUUT61XSIVIdigCNNgx+ZWdAz5++ofre5ogJQ5wcpJ+a2VYuW9gFv7IGVY0SrLc j/Tg== X-Received: by 10.182.176.67 with SMTP id cg3mr5959406obc.65.1372134051253; Mon, 24 Jun 2013 21:20:51 -0700 (PDT) X-Received: by 10.182.176.67 with SMTP id cg3mr5959402obc.65.1372134051145; Mon, 24 Jun 2013 21:20:51 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <8D03F2B8CF0E7BE-1864-1796B@webmail-m103.sysops.aol.com> <8f813b85-9a4e-4612-82b1-dd58f9bfd497@googlegroups.com> From: Benjamin Kaplan Date: Mon, 24 Jun 2013 21:20:30 -0700 Subject: Re: Is this PEP-able? fwhile To: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlTIjjlrNN0CE5IyGfpFWbfFls82ddtlZRhjV7yNrt0uwU1+ttAZVptBRbk2eALBscutAy3BO59DYb3WgyucMCJ0qqzISkMIpzq6YIoYHcsZqdnpygUAaX5cJucgeqIUEyJxY+xIoB24zHjLTWcBm3oMNVxhg== X-Junkmail-Whitelist: YES (by domain whitelist at mpv1.tis.cwru.edu) 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: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1372134435 news.xs4all.nl 15888 [2001:888:2000:d::a6]:38831 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:49125 On Mon, Jun 24, 2013 at 8:54 PM, Chris Angelico wrote: > On Tue, Jun 25, 2013 at 12:01 PM, rusi wrote: >> On Tuesday, June 25, 2013 3:08:57 AM UTC+5:30, Chris Angelico wrote: >>> 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? >> >> Because breaks and continues are just goto-in-disguise? >> >> [Well so is while and if and function-call and... Who is to say that?] > > And that's still not a reason imho. You've just pointed out that > they're all control-flow. :) > > ChrisA The reason I was given (which I promptly ignored, of course) is that it's "best practice" to only have one exit point for a block of code. Only one way of terminating your loop, only one "return" per function, never use exceptions, etc. I think it originally came about as a way to make sure that your clean-up code was called (and to make it easier for code reviewers to make sure your clean up code was called) and then started being passed around as a rule among programming teachers who didn't have any experience outside the classroom.