Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #12519
| References | <e544c1e4-7d5e-4688-bd92-dbb2cd4c179f@k9g2000vbd.googlegroups.com> <mailman.625.1314814411.27778.python-list@python.org> <0cc53b0e-d05b-42fd-96f2-8df6f767e66c@en1g2000vbb.googlegroups.com> |
|---|---|
| Date | 2011-09-01 05:15 +1000 |
| Subject | Re: fun with nested loops |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.628.1314818144.27778.python-list@python.org> (permalink) |
On Thu, Sep 1, 2011 at 5:07 AM, Daniel <dalist0@gmail.com> wrote: >> Do you only ever have one top-level loop that you would be naming? If > no, unfortunately not. The rough structure is several loops deep, and > I need to break/continue/restart many of them. > Continue is used more than break, because most of the time that I find > some strange value, I'd just _continue_ a few levels up > to restart the current measurements. > Ah well, was worth a try. Raising exceptions smells wrong for this, but peppering your code with sentinel checks isn't much better. I don't really know what would be a good solution to this... except maybe this, which was proposed a few years ago and which I'd never heard of until Google showed it to me just now: http://entrian.com/goto/ ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
fun with nested loops Daniel <dalist0@gmail.com> - 2011-08-31 08:51 -0700
Re: fun with nested loops aspineux <aspineux@gmail.com> - 2011-08-31 09:35 -0700
Re: fun with nested loops Daniel <dalist0@gmail.com> - 2011-08-31 11:40 -0700
Re: fun with nested loops Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-01 10:11 +1000
Re: fun with nested loops Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-01 10:50 +1000
Re: fun with nested loops Daniel <dalist0@gmail.com> - 2011-09-01 07:05 -0700
Re: fun with nested loops Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-09-01 16:57 +0200
Re: fun with nested loops Terry Reedy <tjreedy@udel.edu> - 2011-09-01 14:40 -0400
Re: fun with nested loops Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-02 11:04 +1000
Re: fun with nested loops Chris Angelico <rosuav@gmail.com> - 2011-09-01 04:13 +1000
Re: fun with nested loops Daniel <dalist0@gmail.com> - 2011-08-31 12:07 -0700
Re: fun with nested loops Chris Angelico <rosuav@gmail.com> - 2011-09-01 05:15 +1000
Re: fun with nested loops Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-01 10:18 +1000
Re: fun with nested loops Carl Banks <pavlovevidence@gmail.com> - 2011-09-01 12:02 -0700
Re: fun with nested loops Daniel <dalist0@gmail.com> - 2011-09-01 17:21 -0700
csiph-web