Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'encouraging': 0.07; 'subject:code': 0.07; 'executable': 0.09; 'http': 0.09; 'sure,': 0.09; 'cc:addr:python-list': 0.11; 'django': 0.11; '"can\'t': 0.16; '23,': 0.16; 'dump': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'middleware': 0.16; 'roy': 0.16; 'trace.': 0.16; 'subject:python': 0.16; 'exception': 0.16; 'followed': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'stack': 0.19; 'cc:addr:python.org': 0.22; 'mon,': 0.24; 'cc:2**0': 0.24; 'compiled': 0.26; 'header:In-Reply-To:1': 0.27; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; 'obscure': 0.31; 'trace': 0.31; 'figure': 0.32; 'run': 0.32; 'cases': 0.33; 'comment': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'should': 0.36; 'somebody': 0.38; 'pm,': 0.38; 'though,': 0.39; 'dangerous': 0.60; 'happen': 0.63; 'more': 0.64; 'great': 0.65; 'smith': 0.68; 'potentially': 0.81; 'disabled,': 0.84; 'happened.': 0.84; 'careful': 0.91; 'to:none': 0.92; '2013': 0.98 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:cc :content-type; bh=NI4z9kqfs9i0MNk7k7RxO6iQ4eDq2GUAA+gHiCMuYyA=; b=iemtG3/CrdUrIsdLoQbu6nEukhM8uGhHOPnNGqxOglHNuIb+yUgl8N6uYY1MUrsFv/ O7ZlNcD/NEIsT9pakMIYbFoDFf+wAJYkWUmXxcPOzb2xq74+QRR5iO1s+xS9yTYBW0ev 0d1d4CpJhBboIFoUKc0QYSM/36KqrKD071EHg1YOXdYYKhOPgvJvnm+fRRC6SBJqGvWW f+dAYCOggC1JCBSXk4RQUxkmgPXODTvf3OAt5klqNKxRXVmz7AlHSqbKkx0vYPeWcQ6P Sc/HuKmWyKgU9MtMzEpQad3tN9I2Yiv+5/xiUfXIYhlrNk4enoZgB/qNWpSVCc+h6iG6 yT/w== MIME-Version: 1.0 X-Received: by 10.66.160.2 with SMTP id xg2mr23397979pab.23.1387775340587; Sun, 22 Dec 2013 21:09:00 -0800 (PST) In-Reply-To: References: <52b782db$0$6599$c3e8da3$5496439d@news.astraweb.com> <52b7a0e4$0$29994$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 23 Dec 2013 16:09:00 +1100 Subject: Re: cascading python executions only if return code is 0 From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387775349 news.xs4all.nl 2947 [2001:888:2000:d::a6]:38012 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62593 On Mon, Dec 23, 2013 at 3:57 PM, Roy Smith wrote: > More specifically, the assertion exception will get caught way up in > some django middleware which will log a stack trace and return a HTTP > 50-something. This will typically be followed by somebody like me > noticing the stack dump and trying to figure out WTF happened. > > Assertions are great tools. People should use them more often. You do have to be careful though, because they can be compiled out. If it really is a "can't happen", then sure, but encouraging people to use them for potentially obscure cases may be dangerous - if you never happen to hit on it during development and then run with assertions disabled, you won't see that stack trace. However, they're still a lot more executable than other forms of comment :) ChrisA