Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'exception': 0.03; 'abort': 0.09; 'propagate': 0.09; 'cc:addr:python-list': 0.10; 'anyway': 0.11; 'sat,': 0.15; 'exception?': 0.16; 'wrote:': 0.17; 'question.': 0.20; 'bit': 0.21; 'are.': 0.22; 'exceptions': 0.22; 'cc:2**0': 0.23; 'errors': 0.23; 'thus': 0.24; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'chris': 0.28; 'trouble': 0.28; 'maybe': 0.29; 'figure': 0.30; 'handle': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'doing': 0.35; 'pm,': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'subject:with': 0.36; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'save': 0.61; 'yourself': 0.77; '2013': 0.84; 'console,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=lkwu/swt8/8jLtvwHpAZt49A64nBoV4510yKd2/WUsw=; b=k0rN2HUoQZ4v2gXJGuahTkuT0rBA+yff8apf5mrgCUctvCCGA+FQPE17i8o/n45DGW Af5bSWP0m6czq2ON+LckIWi3i80ncX4pyB4HgMdZzxK9xTCSW69HxUWjrPcEQNwki4zZ C9vJ2fGTmZmOuIEhig2GGWaay4UmvBPK9rmxs5JwFY6aMSF9OCYL006c9eBUelENWnAJ mjIhPxhZoBbs8P2iyLuNFrPHy8+CpOmXcPQtCg/A27V6UmRCNgjBnNH/VmAO6nf1l+aS H0jTkr8NFrEVxwl88iufViq2Tj+fFKCFY8I553wU8to+AxwIWbzww6dElrvG9EFpFyA0 Dh6g== X-Received: by 10.52.37.81 with SMTP id w17mr4933564vdj.70.1362252498119; Sat, 02 Mar 2013 11:28:18 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <707df78f-9a67-4ce1-8dd3-095c75a7f7da@googlegroups.com> From: Devin Jeanpierre Date: Sat, 2 Mar 2013 14:27:37 -0500 Subject: Re: Dealing with exceptions To: Chris Angelico Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362252948 news.xs4all.nl 6965 [2001:888:2000:d::a6]:48794 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40358 On Sat, Mar 2, 2013 at 1:21 PM, Chris Angelico wrote: >> now, I need to figure out just what exceptions to handle. > > Here's a bit of a left-field thought: Maybe none of them. > > What are you actually doing when you get an exception? Can you > plausibly recover? If not - that is, if you're going to abort the > whole operation anyway - then save yourself the trouble of writing the > try/catch, and just let the exception propagate up (to the console, if > nowhere else). He can't know if he should handle the errors if he doesn't know what those errors are. Thus the question. -- Devin