Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!diablo1.news.osn.de!news.osn.de!diablo2.news.osn.de!news.tele.dk!news.tele.dk!small.news.tele.dk!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'debugging': 0.07; 'subject:code': 0.07; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'runs': 0.10; 'python': 0.11; 'language.': 0.14; '"can\'t': 0.16; 'buggy': 0.16; 'problem!': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'roy': 0.16; 'subject:python': 0.16; 'ignore': 0.16; 'language': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'mon,': 0.24; 'possibly': 0.26; 'pass': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'on,': 0.29; 'dec': 0.30; 'statement': 0.30; 'code': 0.31; 'assert': 0.31; "d'aprano": 0.31; 'steven': 0.31; "i'd": 0.34; 'problem': 0.35; 'classes': 0.35; "i'll": 0.36; 'to:addr:python-list': 0.38; 'itself': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'free': 0.61; 'our': 0.64; 'biggest': 0.67; 'smith': 0.68; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: cascading python executions only if return code is 0 Date: Mon, 23 Dec 2013 15:22:17 +0000 References: <52b782db$0$6599$c3e8da3$5496439d@news.astraweb.com> <52b7a0e4$0$29994$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: host-78-147-188-167.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: 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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387812153 news.xs4all.nl 2914 [2001:888:2000:d::a6]:42430 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62633 On 23/12/2013 15:12, Dennis Lee Bieber wrote: > On Mon, 23 Dec 2013 13:33:08 +1100, Steven D'Aprano > declaimed the following: > >> Roy Smith wrote: >> >> >>> else: >>> assert 0, "can't create picker (classes = %s)" % classes >> >> ĦAy, caramba! I was with you until the very last line. The above code is >> possibly buggy and inappropriately designed. (I may be completely >> misinterpreting this, in which case feel free to ignore the following >> rant.) >> > > I'd think the biggest problem with this is that if one runs Python with > optimization turned on, the assert statement itself vanishes, leaving one > with an empty else clause... > > Try debugging that problem! > I'll pass on that one :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence