Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'debugging': 0.07; 'subject:code': 0.07; '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; '"can\'t': 0.16; 'buggy': 0.16; 'message-id:@4ax.com': 0.16; 'problem!': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:python': 0.16; 'ignore': 0.16; 'wrote:': 0.18; 'url:home': 0.24; 'mon,': 0.24; 'header:X-Complaints-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; 'skip:> 10': 0.36; 'to:addr :python-list': 0.38; 'itself': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'free': 0.61; 'biggest': 0.67; 'smith': 0.68; 'received:108': 0.93; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: cascading python executions only if return code is 0 Date: Mon, 23 Dec 2013 10:12:57 -0500 Organization: IISS Elusive Unicorn 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 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: adsl-108-68-178-129.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387811582 news.xs4all.nl 2932 [2001:888:2000:d::a6]:34761 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62632 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! -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/