Question about the Exception class

Carl J. Van Arsdall cvanarsdall at mvista.com
Wed Jun 14 16:03:05 EDT 2006


So this is probably a fairly basic question, but help me out because I'm 
just not lining things up and I'm somewhat new to the world of exception 
handling.

What's the benefit to inheriting an exception from and of the available 
parent exception classes?  Does one subclass have benefits over any 
other?  Most of what I see involves making a new class and inheriting 
from Exception so that one can have an exception class with a name of 
their choosing.  If you didn't care about the name would there be any 
benefit to making a subclass versus raising StandardError or something 
else equally vanilla?  Are there any difference to library provided 
exceptions other than their names?

-carl

-- 

Carl J. Van Arsdall
cvanarsdall at mvista.com
Build and Release
MontaVista Software




More information about the Python-list mailing list