Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed6.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'run-time': 0.05; 'raised': 0.07; 'raises': 0.07; '25,': 0.12; 'exception': 0.12; 'am,': 0.13; 'wrote:': 0.15; 'executed.': 0.16; 'fiddle': 0.16; 'finney': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:those': 0.16; 'received:209.85.210.174': 0.19; 'received :mail-iy0-f174.google.com': 0.19; 'header:In-Reply-To:1': 0.22; 'tool,': 0.23; 'obviously': 0.23; 'code': 0.24; 'function': 0.26; 'message-id:@mail.gmail.com': 0.28; 'sat,': 0.28; 'all,': 0.28; 'bound': 0.29; 'object': 0.30; 'can.': 0.30; "it'd": 0.30; "won't": 0.32; 'chris': 0.32; 'list': 0.33; 'to:addr:python-list': 0.34; "can't": 0.34; 'things,': 0.37; 'received:google.com': 0.37; 'but': 0.37; 'received:209.85': 0.38; 'could': 0.38; 'something': 0.38; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'skip:z 10': 0.40; 'would': 0.40; 'jun': 0.67; '"most': 0.84; '10:25': 0.84; 'perfect,': 0.84; 'produce.': 0.84; 'checker': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=SjZWiKJqCT2jgrmVYFQ77oOwI1hE1wEg/PrRi3kPeYQ=; b=Iv2nvMgiwJA0DCkU4j0FA40YASElweVBvcE7MCYAqDEH49UGX+cemZnllLE0EYntED aRnUgY1cMyMCUjkXc1QZvzrpQ7DtWksTqCmrg5oxZplk8EwPNgUNfOGSQNnsBg2VGMpY K8FCTb5S+s5ZWaRaU1pnAwXraPTTH6Tqpj4iA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=fQBXvNUp54bJFl71N+gbB9IHRLWaPswiqPuTcKAXYueQZgU41Tm/DThxTv8szT9UD/ WKyIgJYmYYhHcxfwnXt6YL94DJur7ItfMUN/9ASeuxq1biCvv60OSHHPsL7JOyJi4Z/Y MpIiXoKPVLJfouBBZ6Pm0Q+FCH6//xinN9vOQ= MIME-Version: 1.0 In-Reply-To: <87d3i2oiyo.fsf@benfinney.id.au> References: <96gb36Fc65U1@mid.individual.net> <96itucFadiU1@mid.individual.net> <87d3i2oiyo.fsf@benfinney.id.au> Date: Sat, 25 Jun 2011 13:55:49 +1000 Subject: Re: those darn exceptions From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 19 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1308974152 news.xs4all.nl 185 [::ffff:82.94.164.166]:35208 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:8431 On Sat, Jun 25, 2011 at 10:25 AM, Ben Finney w= rote: > No. The answer is *still* =93why, any exception at all=94. The name > =91os.read=92 could be re-bound at run-time to any object at all, so a co= de > checker that you =93point at any given line of code=94 can't know what th= e > name will be bound to when that line gets executed. Sure it can. And KeyboardInterrupt could be raised at any time, too. But this is a TOOL, not a deity. If Function X is known to call Function Y and built-in method Z, and also raises FooException, then X's list of "most likely exceptions" would be FooException + Y.__exceptions__ + Z.__exceptions__. It won't be perfect, but it'd be something that could go into an autodoc-style facility. Obviously you can fiddle with things, but in _ordinary usage_ this is what it's _most likely_ to produce. Chris Angelico