Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #37296
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!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.005 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'syntax': 0.03; 'none,': 0.05; 'say,': 0.05; 'python': 0.09; 'comment,': 0.09; 'language': 0.14; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'simulate': 0.16; 'subject:when': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'else,': 0.17; 'examples': 0.18; 'jan': 0.18; 'code,': 0.18; '(or': 0.18; 'bit': 0.21; 'matching': 0.23; 'raise': 0.24; 'header :In-Reply-To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'actual': 0.28; 'chris': 0.28; 'knows': 0.30; 'keyword': 0.30; 'anyone': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'expected': 0.35; 'sometimes': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'does': 0.37; '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; '+1100': 0.84; '2013': 0.84; 'confusing': 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=B9yYioMW7bWOuk0U3aCdpD4sw/9LJpg63jAownPBqWo=; b=GepR+ZD1eU2d/RtN9rIiXNz8xu/oF1KRs5b0CoB+wkhYGvR++TOFokrml9PF9PjRIl 7p5oPNemDhrtLzaAMKMZRVCVSI7J4RH6ayvXNSVJVI4ZaQf3nb9Omz7Aw3+SCux6hkbH hi3sQzbM2Zu7sstLVob9WwWrHo5hUAms5V2JEwpeCrhZ/QqWs3Dz5oMjAJRlexLsRVBb FcuzhXeMwy/GyEPdSqsuj9OSqjo0BL8HdfaiVPuaVmg1GDlYzGTmfZDOHMltgKPfxEln 5at+Gm59Nmwuc25V28Nt1Sl6O1327dlqjl7Bwl+8qjo9+gHqxIj8hwt7JFSlOVa0U+qn PMGg== |
| MIME-Version | 1.0 |
| X-Received | by 10.52.178.225 with SMTP id db1mr956115vdc.10.1358870842314; Tue, 22 Jan 2013 08:07:22 -0800 (PST) |
| In-Reply-To | <20130122164835.74a0ebf6@sampi> |
| References | <2cc6791f-ba56-406c-a5b0-b23023caf4bb@googlegroups.com> <mailman.719.1358744056.2939.python-list@python.org> <c0d99c75-c82c-4456-a802-55f9bfd43240@googlegroups.com> <mailman.725.1358744831.2939.python-list@python.org> <20130122163924.74038876@sampi> <mailman.799.1358869356.2939.python-list@python.org> <20130122164835.74a0ebf6@sampi> |
| Date | Wed, 23 Jan 2013 03:07:21 +1100 |
| Subject | Re: Else statement executing when it shouldnt |
| 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.15 |
| 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.802.1358870851.2939.python-list@python.org> (permalink) |
| Lines | 20 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1358870851 news.xs4all.nl 6867 [2001:888:2000:d::a6]:54649 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:37296 |
Show key headers only | View raw
On Wed, Jan 23, 2013 at 2:48 AM, Thomas Boell <tboell@domain.invalid> wrote: > On Wed, 23 Jan 2013 02:42:27 +1100 > Chris Angelico <rosuav@gmail.com> wrote: > >> On Wed, Jan 23, 2013 at 2:39 AM, Thomas Boell <tboell@domain.invalid> 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. :) > > I must say, that's bound to be confusing for anyone who knows any > language other than Python (or none, even). Syntax like that is "an > accident waiting to happen"... It can be confusing and does take that bit of learning, but it's SO handy. In C code, I sometimes simulate it with a 'goto' and a comment, but the actual keyword is much clearer. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Else statement executing when it shouldnt eli m <techgeek201@gmail.com> - 2013-01-20 20:40 -0800
Re: Else statement executing when it shouldnt Roy Smith <roy@panix.com> - 2013-01-20 23:47 -0500
Re: Else statement executing when it shouldnt Chris Angelico <rosuav@gmail.com> - 2013-01-21 15:52 +1100
Re: Else statement executing when it shouldnt eli m <techgeek201@gmail.com> - 2013-01-20 20:55 -0800
Re: Else statement executing when it shouldnt eli m <techgeek201@gmail.com> - 2013-01-20 20:55 -0800
Re: Else statement executing when it shouldnt eli m <techgeek201@gmail.com> - 2013-01-20 20:54 -0800
Re: Else statement executing when it shouldnt alex23 <wuwei23@gmail.com> - 2013-01-20 22:00 -0800
Re: Else statement executing when it shouldnt Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-21 08:04 +0000
Re: Else statement executing when it shouldnt René Klačan <rene.klacan@gmail.com> - 2013-01-21 05:54 +0100
Re: Else statement executing when it shouldnt eli m <techgeek201@gmail.com> - 2013-01-20 20:57 -0800
Re: Else statement executing when it shouldnt René Klačan <rene.klacan@gmail.com> - 2013-01-21 06:06 +0100
Re: Else statement executing when it shouldnt René Klačan <rene.klacan@gmail.com> - 2013-01-21 06:07 +0100
Re: Else statement executing when it shouldnt Thomas Boell <tboell@domain.invalid> - 2013-01-22 16:39 +0100
Re: Else statement executing when it shouldnt Chris Angelico <rosuav@gmail.com> - 2013-01-23 02:42 +1100
Re: Else statement executing when it shouldnt Thomas Boell <tboell@domain.invalid> - 2013-01-22 16:48 +0100
Re: Else statement executing when it shouldnt Chris Angelico <rosuav@gmail.com> - 2013-01-23 03:07 +1100
Re: Else statement executing when it shouldnt Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:22 +0000
Re: Else statement executing when it shouldnt René Klačan <rene.klacan@gmail.com> - 2013-01-23 01:34 +0100
Re: Else statement executing when it shouldnt Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-22 22:11 -0500
Re: Else statement executing when it shouldnt alex23 <wuwei23@gmail.com> - 2013-01-22 17:28 -0800
Re: Else statement executing when it shouldnt Thomas Boell <tboell@domain.invalid> - 2013-01-23 12:22 +0100
Re: Else statement executing when it shouldnt Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-01-23 15:35 +0200
Re: Else statement executing when it shouldnt Jerry Hill <malaclypse2@gmail.com> - 2013-01-23 09:53 -0500
Re: Else statement executing when it shouldnt Frank Millman <frank@chagford.com> - 2013-01-25 10:15 +0200
Re: Else statement executing when it shouldnt Duncan Booth <duncan.booth@invalid.invalid> - 2013-01-22 15:48 +0000
Re: Else statement executing when it shouldnt Duncan Booth <duncan.booth@invalid.invalid> - 2013-01-22 15:52 +0000
Re: Else statement executing when it shouldnt eli m <techgeek201@gmail.com> - 2013-01-20 20:57 -0800
Re: Else statement executing when it shouldnt Mitya Sirenef <msirenef@lightbird.net> - 2013-01-20 23:57 -0500
Re: Else statement executing when it shouldnt eli m <techgeek201@gmail.com> - 2013-01-20 20:59 -0800
Re: Else statement executing when it shouldnt Mitya Sirenef <msirenef@lightbird.net> - 2013-01-21 01:09 -0500
Re: Else statement executing when it shouldnt eli m <techgeek201@gmail.com> - 2013-01-20 20:59 -0800
Re: Else statement executing when it shouldnt alex23 <wuwei23@gmail.com> - 2013-01-20 21:46 -0800
Re: Else statement executing when it shouldnt alex23 <wuwei23@gmail.com> - 2013-01-20 21:56 -0800
Re: Else statement executing when it shouldnt eli m <techgeek201@gmail.com> - 2013-01-21 07:37 -0800
Re: Else statement executing when it shouldnt Chris Angelico <rosuav@gmail.com> - 2013-01-22 05:44 +1100
csiph-web