Re: How to determine what exceptions a method might raise?

2007-01-17 Thread Duncan Booth
"George Sakkis" <[EMAIL PROTECTED]> wrote: > As for the OP's question, since file is a fixed builtin, I think it > should be possible to know all the possible exceptions that can be > raised; I'm not sure if it's clearly documented though. Just calling 'file' the most obvious exceptions it can ra

Re: How to determine what exceptions a method might raise?

2007-01-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, 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 > pi

Re: How to determine what exceptions a method might raise?

2007-01-17 Thread George Sakkis
Ben Finney wrote: > Ed Jensen <[EMAIL PROTECTED]> writes: > > > it would be handy if there was something I could do in the > > interactive interpreter to make it tell me what exceptions the file > > method might raise (such as IOError). > > For what purpose would this be handy? Surely the benefit

Re: How to determine what exceptions a method might raise?

2007-01-16 Thread Ben Finney
Ed Jensen <[EMAIL PROTECTED]> writes: > it would be handy if there was something I could do in the > interactive interpreter to make it tell me what exceptions the file > method might raise (such as IOError). For what purpose would this be handy? Surely the benefit of the interactive interpreter

Re: How to determine what exceptions a method might raise?

2007-01-16 Thread Harlin Seritt
Hi Ed, Generally checking the sources give a very good clue as to what exceptions the interpreter can raise. Look around _builtins_ for this. Harlin Seritt Ed Jensen wrote: > I'm really enjoying using the Python interactive interpreter to learn > more about the language. It's fantastic you can

How to determine what exceptions a method might raise?

2007-01-16 Thread Ed Jensen
I'm really enjoying using the Python interactive interpreter to learn more about the language. It's fantastic you can get method help right in there as well. It saves a lot of time. With that in mind, is there an easy way in the interactive interpreter to determine which exceptions a method migh