Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: breaking out of outer loops Date: Mon, 7 Mar 2016 16:17:48 -0700 Lines: 9 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de Kowas01IcXFUlIjVl2pMRQbSd7FeQ3+w/X6BJUst0IeQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.045 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'received:209.85.223': 0.03; 'python.': 0.11; '2016': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:breaking': 0.16; 'wrote:': 0.16; 'nested': 0.18; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'message-id:@mail.gmail.com': 0.27; 'code': 0.30; "can't": 0.32; 'received:google.com': 0.35; 'label': 0.35; 'something': 0.35; 'there': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'missing': 0.37; 'no,': 0.38; 'received:209': 0.38; 'does': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'mar': 0.65; 'apart': 0.70; 'to:name:python': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=YqIhcEQdoeAiRl8J2fWbzueG5Bex7VDTBeNBTqh+fk0=; b=yoYshLoe0fDJJ+BCFE+9Gho8FOqmQjARyibvEHi1sE/Zv76yWUPffEv9BRr4nPHNY0 pELY9gZM0Auk/6AYEVx7RW4iRYtIvTgjou2tO67lw4qZxgGk9lLHMsEHQxs79NN6twQk 4sP9GL932ePHf1ua8K8olAT1QeURBKgmKMZT9MAmeWbDanYT62kPCeIAv8lP1fkcW4bA ygqWW3+Vn87TQzXx4UyYUpafdVHKCAXj/AnNIPz4s39o+oeQ5J1y75ZYqj4ep0ZlHyo0 6bot1aivciuNogARWNw0Vve4AXXkpwNflZnIhxU35G8nrxSoZ9sYCucU3FvfUDsh+f7b dAHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=YqIhcEQdoeAiRl8J2fWbzueG5Bex7VDTBeNBTqh+fk0=; b=V3gm+ZERPT/67smHONd/Cf2kpH69hZ2S417TA89t6YyguCYfeIwjdFmXqCNBzX+NgC CWQ3zkyoPRMZ0iS/vhkNSWIAQ0mYYzIBjbcvY4lobrZ7BdVLpAe4WY08l1Rmt3Dwv1Rn meMYj9v4gMs82wb8v4YNPLKEfWfnd4zC2iqAmJ+6flrp+L4y35T7kGiY/zMDzFMoFKGv Hh74oS44BCOBYAo1QFG20OVJyKJLEFEI9IhCn2L9s77E8IycinxSIJYDnZr9y8JIfSN5 Mq/WBz9MRbZMv+scIKDwXnso/zjMNV1GXUJyErgqeKL7vJtAeGmu9dWV29Q0gUElD93I J7bw== X-Gm-Message-State: AD7BkJIJpK+/pSdefRuUguxzxLXZxGxsa91JokCOY66yl8foqjv617GPHeO5CWrLWgznRn5jJz0ygMj/JOV0Rg== X-Received: by 10.107.19.140 with SMTP id 12mr22819539iot.11.1457392707345; Mon, 07 Mar 2016 15:18:27 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:104268 On Mon, Mar 7, 2016 at 4:09 PM, Fillmore wrote: > > I must be missing something simple because I can't find a way to break out > of a nested loop in Python. > > Is there a way to label loops? No, you can't break out of nested loops, apart from structuring your code such that return does what you want.