Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'affected': 0.07; 'subject:code': 0.07; 'exception.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'try:': 0.09; 'mostly': 0.14; "(i'm": 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'worse.': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'pieces': 0.19; 'header:User-Agent:1': 0.23; 'features,': 0.24; 'pass': 0.26; 'header:X-Complaints-To:1': 0.27; 'point': 0.28; 'feature': 0.29; 'raise': 0.29; "i'm": 0.30; 'assert': 0.31; 'run': 0.32; 'beginning': 0.33; 'comment': 0.34; 'except': 0.35; 'test': 0.35; 'clear': 0.37; 'easily': 0.37; 'sometimes': 0.38; 'to:addr:python-list': 0.38; 'list,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'major': 0.40; 'skip:u 10': 0.60; 'ethan': 0.84; 'furman': 0.84; 'confidence': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: cascading python executions only if return code is 0 Date: Mon, 23 Dec 2013 18:45:29 +0100 Organization: None References: <52b782db$0$6599$c3e8da3$5496439d@news.astraweb.com> <52b7a0e4$0$29994$c3e8da3$5496439d@news.astraweb.com> <52B85E0C.3060006@stoneleaf.us> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p5084ac55.dip0.t-ipconnect.de User-Agent: KNode/4.7.3 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: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387820727 news.xs4all.nl 2936 [2001:888:2000:d::a6]:60897 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62644 Ethan Furman wrote: >> Sigh. Sometimes I'm not sure which is worse. The anti-assertion >> zealotry on this list, or the anti-regex zealotry. > > I am not a zealot (I'm not! Really!! ;) . I just find it alarming to > have major pieces of software rely on a feature that can be so easily > tuned out, and it wasn't clear from your comment that it was /any/ > exception. > > Mostly I don't want newbies thinking "Hey! I can use assertions for all > my confidence testing!" > > Just as one data point OpenERP, which has a lot of good features, > unfortunately uses assert to test user input. :( Put the following at the beginning of every affected module: try: assert 0 except AssertionError: pass else: raise AssertionError("won't run with assertions turned off") :)