Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.086 X-Spam-Evidence: '*H*': 0.83; '*S*': 0.00; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:when': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'else,': 0.17; 'examples': 0.18; 'jan': 0.18; 'matching': 0.23; 'raise': 0.24; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'to:addr :python-list': 0.33; 'received:google.com': 0.34; 'expected': 0.35; 'received:209.85': 0.35; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'things': 0.38; 'to:addr:python.org': 0.39; 'your': 0.60; 'thomas': 0.62; "'for'": 0.84; "'while'": 0.84; '2013': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=tVz/4mk35gTROdsMN/IDcMKW6lJ56lYLTR4O1ibkJ6E=; b=KZN1LxP6PmDHYvIOFa/IoQP2q6QfsUg/gySqaBBOnucGJdj6oO7mennokdQqoUBX7T 2KOWCZE1eOCpfzeAjiX0W8WSzLECqnEd2AAUdw/gkeUIhxyYUemUjWOS3soYpjoULK7S YmqoKszPNyr/uVoC5gTjD+vQk2ycjYmar+/oDpEIp6IR47DGiX0D51FuVuORovW+UKIH cfWA/Jf6mj0eBMQ6H83qAInTXzn2dNu3vJ5j+u2l7eEi5GSszCIjFZg9NNIVcrdc/nS+ R10EemBCS1t0xkwO3DIViQQ9FgvSzMpz5E1RKMNoUv0MZ6WI9nkEQ3s4rKtTjurSlhMX C3/A== MIME-Version: 1.0 X-Received: by 10.52.29.109 with SMTP id j13mr16808316vdh.111.1358869347807; Tue, 22 Jan 2013 07:42:27 -0800 (PST) In-Reply-To: <20130122163924.74038876@sampi> References: <2cc6791f-ba56-406c-a5b0-b23023caf4bb@googlegroups.com> <20130122163924.74038876@sampi> Date: Wed, 23 Jan 2013 02:42:27 +1100 Subject: Re: Else statement executing when it shouldnt 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.15 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: 8 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358869356 news.xs4all.nl 6887 [2001:888:2000:d::a6]:33500 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37288 On Wed, Jan 23, 2013 at 2:39 AM, Thomas Boell wrote: > Huh?! I would have expected all your examples to raise a SyntaxError or > IndentationError. Why don't they? Is 'else' not required to have a > matching 'if'? Other things can have else, including 'for' and 'while' loops. :) ChrisA