Best Way to Handle All Exceptions

Terry Reedy tjreedy at udel.edu
Mon Jul 13 16:19:14 EDT 2009


Diez B. Roggisch wrote:

> The latter is - unfortunately - the better. This comes from python allowing
> all kinds of objects being thrown as exceptions, not only those extending
> from a common ancestor like Exception.

Fixed in Python 3. exceptions, without exceptions, are instances of 
BaseException, either directly or as instances of subcleasses of 
BaseException.

One of many reasons to switch when possible.
tjr




More information about the Python-list mailing list