Equivalent of Java 'throws'

Daniel Klein danielk at aracnet.com
Tue Jan 2 01:32:23 EST 2001


Here's another 'is there a Pythonic way to do this' question...

In Java, you can specify a 'throws' to tell a client using your
methods of your class that they must have an exception handler. This
appears to be checked when the client is compiled.

 I've read thru the reference materials concerning exceptions and this
one's got me stumped.  Is there any way in Python to do this? I
suspect there isn't since Python is dynamically typed.

If there is, please point me to this; if not, that's ok too, I'll just
document the api to my class appropriately.

Thanks from a new Python convert,

Daniel Klein
Portland, OR USA



More information about the Python-list mailing list