Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #8420
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!news.glorb.com!news.astraweb.com!border5.newsrouter.astraweb.com!not-for-mail |
|---|---|
| From | Ben Finney <ben+python@benfinney.id.au> |
| Newsgroups | comp.lang.python |
| Subject | Re: those darn exceptions |
| References | <itot0b022i@news4.newsguy.com> <96gb36Fc65U1@mid.individual.net> <iu00uh2dhg@news3.newsguy.com> <96itucFadiU1@mid.individual.net> <iu2kif0coj@news4.newsguy.com> |
| X-Public-Key-ID | 0xAC128405 |
| X-Public-Key-Fingerprint | 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 |
| X-Public-Key-URL | http://www.benfinney.id.au/contact/bfinney-pubkey.asc |
| X-Post-From | Ben Finney <bignose+hates-spam@benfinney.id.au> |
| Date | Sat, 25 Jun 2011 10:25:35 +1000 |
| Message-ID | <87d3i2oiyo.fsf@benfinney.id.au> (permalink) |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
| Cancel-Lock | sha1:xFJwmv1NXOh2NmdQTgw5SavKYsE= |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 8bit |
| Lines | 33 |
| Organization | Unlimited download news at news.astraweb.com |
| NNTP-Posting-Host | f824e2ba.news.astraweb.com |
| X-Trace | DXC=VH]>82Db@@9J0Z]=gbPP29L?0kYOcDh@:N7:H2`MmAU3F8TiH9LRjf1]G;2>V^?kW3bEW9A[5UK?5NZ[SL`C\Kg3kH[l9EU2439 |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:8420 |
Show key headers only | View raw
Chris Torek <nospam@torek.net> writes:
> But again, this is why I would like to have the ability to use some
> sort of automated tool, where one can point at any given line of
> code and ask: "what exceptions do you, my faithful tool, believe
> can be raised as a consequence of this line of code?"
“Why, any exception at all”.
> If you point it at the call to main():
>
> if __name__ == '__main__':
> main()
>
> then you are likely to get a useless answer ("why, any exception
> at all"); but if you point it at a call to os.read(), then you get
> one that is useful -- and tells you (or me) about the OverflowError.
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.
> If you point it at a call to len(x), then the tool tells you what
> it knows about type(x) and x.__len__.
Which information, before the code is executed, isn't determined.
--
\ “The cost of education is trivial compared to the cost of |
`\ ignorance.” —Thomas Jefferson |
_o__) |
Ben Finney
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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