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: 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: References: Date: Thu, 1 Sep 2011 04:13:22 +1000 Subject: Re: fun with nested loops 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.12 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: 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 On Thu, Sep 1, 2011 at 1:51 AM, Daniel 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