Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'languages,': 0.04; 'case.': 0.05; 'terry': 0.09; 'through.': 0.09; 'dec': 0.15; 'sat,': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'reedy': 0.16; 'subject:compare': 0.16; 'wrote:': 0.17; 'exceptions': 0.22; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'catching': 0.29; 'received:209.85.160.46': 0.32; 'to:addr:python- list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'depends': 0.36; 'flow': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'skip:u 10': 0.60; 'most': 0.61; 'costs': 0.64; 'checks.': 0.91 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:to :content-type; bh=4zOf+wOzVAWC0N4dHi2+Pk6xTiDemvlSxj+2yhSjWQI=; b=WklFOuTjgt2DlikcMRjasO+iEqOaZ5FtNNIJT3bnoK60wl7QOSt2oWkkLCICQTov1/ t/qjx8qsl/83sjWY7jEWqAOwve90NRY7vMWdxkZnhuB9BZp3zFx70j6yBnq/vEKLf5ZQ 5rVJ/wvawhAUKZXCzGE0KwE25cqQ4QjObrg2W2DEB5IleE0FBnnI092izTtSJedJ/f96 bAMJpoJkOBk2aUlL+tQ/+Yw5a532UTV+Lx8LEY97RZbE4+179T0GCVHykNrOqXnhJ8UV MR4U7I6+IyzNta7c5PtHRcg8G+3ccgB2J6lk3vxbfLRjXT1NNcwiwdjjVNZCypl2XNGm cV6Q== MIME-Version: 1.0 In-Reply-To: References: <50c01fe2$0$21853$c3e8da3$76491128@news.astraweb.com> <50c085e5$0$29994$c3e8da3$5496439d@news.astraweb.com> <50c26aa6$0$29994$c3e8da3$5496439d@news.astraweb.com> Date: Sat, 8 Dec 2012 18:17:19 +1100 Subject: Re: Confused compare function :) From: Chris Angelico To: python-list@python.org 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1354951042 news.xs4all.nl 6966 [2001:888:2000:d::a6]:33046 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34490 On Sat, Dec 8, 2012 at 6:01 PM, Terry Reedy wrote: > Unfortunately, catching exceptions may be and often is as slow as the > redundant check and even multiple redundant checks. It depends on how often you're going to catch and how often just flow through. In Python, as in most other modern languages, exceptions only cost you when they get thrown. The extra check, though, costs you in the normal case. ChrisA