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


Groups > comp.lang.python > #12512

Re: fun with nested loops

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.043
X-Spam-Evidence '*H*': 0.91; '*S*': 0.00; 'top-level': 0.09; 'am,': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:loops': 0.16; 'wrote:': 0.16; 'received:209.85.210.174': 0.18; 'received:mail-iy0-f174.google.com': 0.18; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'sep': 0.23; 'skip:b 20': 0.26; 'function': 0.27; 'loop': 0.28; 'thu,': 0.28; 'message- id:@mail.gmail.com': 0.29; 'anyone': 0.32; 'to:addr:python-list': 0.33; 'instead': 0.33; 'daniel': 0.34; 'idea': 0.34; 'put': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'subject:with': 0.39; 'to:addr:python.org': 0.39; 'ever': 0.65; 'subject:fun': 0.67; 'deeply': 0.68; 'break.': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=wjI14l7uofiUc2j6cpGtdiPMRNDSADlfIPBtUuaU6fM=; b=I2RhPlFfjeS46OQu/iAWlNBjJ27ZOF+tcrckKIqoH+N5LnHYb4SRmjMedE0YJE+4Nj nrMa7VmAYUcXycWOdZPpit9gYMQuAPVyS/0663JERzBHLTnjvirk+eAQYehigCd+YOeG c0iy0kmS3aEa1DFRkkdOanZksPEfMhCMz1rEM=
MIME-Version 1.0
In-Reply-To <e544c1e4-7d5e-4688-bd92-dbb2cd4c179f@k9g2000vbd.googlegroups.com>
References <e544c1e4-7d5e-4688-bd92-dbb2cd4c179f@k9g2000vbd.googlegroups.com>
Date Thu, 1 Sep 2011 04:13:22 +1000
Subject Re: fun with nested loops
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.625.1314814411.27778.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1314814411 news.xs4all.nl 2401 [2001:888:2000:d::a6]:53522
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:12512

Show key headers only | View raw


On Thu, Sep 1, 2011 at 1:51 AM, Daniel <dalist0@gmail.com> wrote:
>
> Has anyone an idea on a nice way to write breaks/continues/redos for
> deeply
> nested loops?
>

Do you only ever have one top-level loop that you would be naming? If
so, put that loop into a function and use return instead of break.
Unfortunately that doesn't work for continue.

ChrisA

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


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