Exception handling

Järvinen Petri jarvin24 at lehtori.cc.tut.fi
Wed May 8 06:46:21 EDT 2002


Hello

Is it possible to use dynamic binding in exception handling like in C++.

I mean can I catch baseclass exception in my exception handler and get all 
the derived classes catched aswell, like

Class A:

Class B(A):

Class C(A):

try:
 ...
except A:
 (this would catch also B and C)


* of course I could type except (A, B, C): but i rather not, because there 
are lot's of derived exceptions.

Thanks allready,

Petri



More information about the Python-list mailing list