Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'exception': 0.03; 'kind,': 0.05; 'clause': 0.07; 'dec': 0.15; '(assuming': 0.16; 'clause,': 0.16; 'for,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:compare': 0.16; 'succeeded.': 0.16; 'wrote:': 0.17; 'else,': 0.17; 'version.': 0.17; 'assignment': 0.22; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message- id:@mail.gmail.com': 0.27; 'bad.': 0.29; 'fri,': 0.30; 'code': 0.31; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'done': 0.34; 'doing': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'there': 0.35; "didn't": 0.36; 'does': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'your': 0.60; 'original.': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=08MfdxM+rQjl3t9krAFR6R0za92PdZsvqGnxTxU2RZQ=; b=xVxaJ3z6RosualUBLOqkeeOXFfgZnUIIP27/3T6ysljxVJ20x9/LCEIF60EKLDcGnj RP3ylrM2CPSE+V1N0tMjPwLvdKI4G88r6CLM2QGitTMHFFLMzfj9KMMJ5UTy1rVMIbue Fc9YaXw7bxxFihLAtVhvU9tkEi/A4GQuyaCZPeqUbtI44D/SObUlR9ix5B8VCfc9ij83 N3dvetZNlqS8t1K3wWY5LSg1ByjMQY5KyrE0oHpmMYSiGVyaCglViVE+zz+YVj0SpaW0 LojfRnhfZWaGOGzOAFMgvWCb3hixXl8tgt5yRAZJtFeKLEoK2yMWiGvs7Rt7MTUjXn55 hX2A== MIME-Version: 1.0 In-Reply-To: <50c0a9e2$0$6963$e4fe514c@news2.news.xs4all.nl> References: <50c01fe2$0$21853$c3e8da3$76491128@news.astraweb.com> <50c0a9e2$0$6963$e4fe514c@news2.news.xs4all.nl> Date: Fri, 7 Dec 2012 01:28:36 +1100 Subject: Re: Confused compare function :) 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1354804118 news.xs4all.nl 6850 [2001:888:2000:d::a6]:57327 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34393 On Fri, Dec 7, 2012 at 1:21 AM, Hans Mulder wrote: > Errhm, no. Look again. The do_stuff(value) call is in the "else:" > clause, so it will only be done of there was no Exception of any > kind, and in that case the assignment to value must have succeeded. DOH! My bad. Sorry! I somehow didn't see your else, *and* didn't think of that clause when doing up my "fixed" version. Yep, else is precisely what this calls for, and (assuming the change I mentioned) your code does indeed match the original. ChrisA