Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.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.080 X-Spam-Evidence: '*H*': 0.84; '*S*': 0.00; 'exception': 0.03; 'exception,': 0.09; 'propagate': 0.09; 'tends': 0.09; 'advocating': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'feb': 0.19; 'exceptions': 0.22; 'seems': 0.23; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; "d'aprano": 0.29; 'steven': 0.29; 'e.g.': 0.30; 'up.': 0.31; 'raising': 0.33; 'to:addr:python- list': 0.33; 'likely': 0.33; 'agree': 0.34; 'received:google.com': 0.34; 'returning': 0.35; 'said,': 0.35; 'pm,': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'rather': 0.37; 'received:209': 0.37; 'far': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; "you've": 0.61; 'bring': 0.62; 'more': 0.63; 'making': 0.64; '2013': 0.84; 'crowd': 0.84; 'to:name:python': 0.84; 'mistake': 0.91; 'prone': 0.91 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:content-type; bh=mWbH958thiENOnAfD3LZvEQqvwD/LoBnVpTqyLUN8P8=; b=sO4QQccc/LYoZctp/vIME7HvuKg1216ZgHUoKrXZoAJFYTVZrC8pWtjtVY7ojYOnLy OLD7j682wzGzgL3HYCJoKUythOwBLbtvqV4bbK505nc8DtJBHYRIKaLUOTS6TYwdE3i3 cke+aW/5xPRDvC38cYXzeJWLmDJX90/Enf+A1dPEA9gsu39yKgrBXr0XxhqG1CIQy+Tj 2ERKc/ZX1Al1zucfyOe4heyRob2qiSXy2U2eiPyQiC3Lb0ueyWRRNwdHK+XPEqu7Kb5e Oeb+C988K0loJSBcmUkkqLyOW+sfkVoUuzLqO//62qfzc/AzjYX8y5QTyo2EBM98fJ3N U9zg== X-Received: by 10.66.83.165 with SMTP id r5mr61050161pay.3.1360042884513; Mon, 04 Feb 2013 21:41:24 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <51109001$0$21856$c3e8da3$76491128@news.astraweb.com> References: <5110415c$0$29986$c3e8da3$5496439d@news.astraweb.com> <51109001$0$21856$c3e8da3$76491128@news.astraweb.com> From: Ian Kelly Date: Mon, 4 Feb 2013 22:40:54 -0700 Subject: Re: LBYL vs EAFP To: Python Content-Type: text/plain; charset=ISO-8859-1 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360042892 news.xs4all.nl 6891 [2001:888:2000:d::a6]:47525 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38164 On Mon, Feb 4, 2013 at 9:52 PM, Steven D'Aprano wrote: > You seem to be making the > classic mistake of thinking that exceptions are something to avoid: Far from it. You've extrapolated a lot more than what I actually said, and I completely agree with everything you wrote. I was explaining EAFP as I see it, not advocating it for all circumstances. Although since you bring it up, I find that the LBYL crowd tends to be more prone to exception avoidance, e.g. returning None on a failure rather than raising an exception, whereas the EAFP crowd seems more likely to just let the original exception propagate up.