Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49092

Re: Is this PEP-able? fwhile

References <8D03F2B8CF0E7BE-1864-1796B@webmail-m103.sysops.aol.com>
Date 2013-06-25 07:38 +1000
Subject Re: Is this PEP-able? fwhile
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3773.1372110329.3114.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Jun 25, 2013 at 5:52 AM,  <jimjhb@aol.com> 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

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Is this PEP-able? fwhile Chris Angelico <rosuav@gmail.com> - 2013-06-25 07:38 +1000
  Re: Is this PEP-able? fwhile rusi <rustompmody@gmail.com> - 2013-06-24 19:01 -0700
    Re: Is this PEP-able? fwhile Chris Angelico <rosuav@gmail.com> - 2013-06-25 13:54 +1000
    Re: Is this PEP-able? fwhile Benjamin Kaplan <benjamin.kaplan@case.edu> - 2013-06-24 21:20 -0700
    Re: Is this PEP-able? fwhile Chris Angelico <rosuav@gmail.com> - 2013-06-25 17:21 +1000
    Re: Is this PEP-able? fwhile Ian Kelly <ian.g.kelly@gmail.com> - 2013-06-25 10:00 -0600
      Re: Is this PEP-able? fwhile rusi <rustompmody@gmail.com> - 2013-06-25 09:19 -0700
        Re: Is this PEP-able? fwhile Neil Cerutti <neilc@norwich.edu> - 2013-06-26 13:09 +0000
    Re: Is this PEP-able? fwhile Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-06-25 20:40 -0400
      Re: Is this PEP-able? fwhile jfharden@gmail.com - 2013-06-26 03:00 -0700
      Re: Is this PEP-able? fwhile Jerry Peters <jerry@example.invalid> - 2013-06-26 19:56 +0000

csiph-web