How to determine what exceptions a method might raise?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Wed Jan 17 04:04:59 EST 2007


In <1169022894.357383.45950 at a75g2000cwd.googlegroups.com>, George Sakkis
wrote:
> Ben Finney wrote:
>
>> But, in case it helps: Any code may raise any exception at any
>> time. This is a feature, since it encourages program that are tested
>> properly.
> 
> That's a silly argument, really, unless perhaps you'd consider a box of
> pills that look like M&Ms a 'feature' since it encourages parents to
> hide them from their kids. A better answer would be along the lines of
> "yes, that would be nice to have but in general it's not possible in a
> dynamic language; that's the price you have to pay for leaving the
> static typing world".

I don't thing that's a dynamic vs. static thing because in statically
typed languages it's not that easy to find out all possible exceptions
unless the language forces you to declare them.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list