documenting excepetions in Python

kyosohma at kyosohma at
Fri Oct 19 17:44:49 CEST 2007

On Oct 19, 10:32 am, dale_bertr... at wrote:
> In python, how do I know what exceptions a method could raise?  Do I
> need to look at the source?  I don't see this info in the API docs for
> any of the APIs I'm using.
> Thanks in advance for your help.

Read the source, run unit tests, etc. If you write your own methods,
you might consider writing tests beforehand:

Sometimes the module's docs will tell you the likely return values,
which can help you know what exceptions to look out for.


More information about the Python-list mailing list