Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8431

Re: those darn exceptions

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 <rosuav@gmail.com>
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 <itot0b022i@news4.newsguy.com> <96gb36Fc65U1@mid.individual.net> <iu00uh2dhg@news3.newsguy.com> <96itucFadiU1@mid.individual.net> <iu2kif0coj@news4.newsguy.com> <87d3i2oiyo.fsf@benfinney.id.au>
Date Sat, 25 Jun 2011 13:55:49 +1000
Subject Re: those darn exceptions
From Chris Angelico <rosuav@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.401.1308974152.1164.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Sat, Jun 25, 2011 at 10:25 AM, Ben Finney <ben+python@benfinney.id.au> wrote:
> No. The answer is *still* “why, any exception at all”. The name
> ‘os.read’ could be re-bound at run-time to any object at all, so a code
> checker that you “point at any given line of code” can't know what the
> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

those darn exceptions Chris Torek <nospam@torek.net> - 2011-06-21 01:43 +0000
  Re: those darn exceptions Chris Angelico <rosuav@gmail.com> - 2011-06-21 13:19 +1000
    Re: those darn exceptions Chris Torek <nospam@torek.net> - 2011-06-21 04:40 +0000
  Re: those darn exceptions Ben Finney <ben+python@benfinney.id.au> - 2011-06-21 14:04 +1000
  Re: those darn exceptions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-21 09:49 +0000
    Re: those darn exceptions Chris Torek <nospam@torek.net> - 2011-06-21 21:51 +0000
      Re: those darn exceptions John Nagle <nagle@animats.com> - 2011-06-27 11:52 -0700
  Re: those darn exceptions Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-06-23 20:16 +1200
    Re: those darn exceptions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-23 18:40 +1000
    Re: those darn exceptions Chris Torek <nospam@torek.net> - 2011-06-23 18:33 +0000
      Re: those darn exceptions Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-06-24 19:50 +1200
        Re: those darn exceptions Chris Torek <nospam@torek.net> - 2011-06-24 18:21 +0000
          Re: those darn exceptions Ben Finney <ben+python@benfinney.id.au> - 2011-06-25 10:25 +1000
            Re: those darn exceptions Chris Angelico <rosuav@gmail.com> - 2011-06-25 13:55 +1000
              Re: those darn exceptions steve+comp.lang.python@pearwood.info - 2011-06-26 00:28 +1000
                Re: those darn exceptions Chris Angelico <rosuav@gmail.com> - 2011-06-26 01:52 +1000

csiph-web