Hi,

Until now, the normal way to create a new exception type was by inheriting from 
Exception. At least, it was the recommended way in the manual (and is still). 
In the development version and in the new 1.2 version, this is considered bad 
style and you get a warning if you inherit from Exception. It’s logic as there 
exist now catchable and non-catchable errors.

It is now recommended to inherit from OSError, IOError, ValueError or some 
other catchable error. OK, but I have written some code using a custom 
exception and this exception is not some kind of OSError, IOError, ValueError 
and so on. It’s an application exception which may be raised by miscellaneous 
causes. Inheriting from ValueError (one of the most general exception) makes 
little sense except in some particular cases.

Of course, it doesn’t matter a lot, but I don’t like things which are not logic 
and inheriting from ValueError would not be logic. For me, the best solution 
would be to inherit from CatchableError. Now, would this be considered OK or 
would it be also bad style?

Reply via email to