What c.l.py's opinions about Soft Exception?
Diez B. Roggisch
deets at nospam.web.de
Tue Mar 11 08:50:37 CET 2008
> If all you wanted was some grouping of exceptions why not something
> soft_exception_list = [IndexError, TypeError]
> hard_exception_list = [ZeroDivision]
> except Exception, e:
> if e.__class__ in soft_exception_list:
> elif e.__class__ in hard_exception_list:
> raise NotImplementedError
> Granted you're most likely looking for something that does this
> constantly on every line of code though...
It's not about grouping, which would be done better with inheritance by
Its about not raising certain exceptions if there is no handler.
More information about the Python-list