StandardError in Python 2 -> 3

Ian Kelly ian.g.kelly at gmail.com
Fri Nov 16 20:51:53 EST 2012


On Fri, Nov 16, 2012 at 6:30 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Does anyone use StandardError in their own code? In Python 2, I normally
> inherit from StandardError rather than Exception. Should I stop and just
> inherit from Exception in both 2 and 3?

According to the docs, StandardError is for built-in exceptions, and
user-defined exceptions are meant to inherit from Exception.

http://docs.python.org/2/library/exceptions.html#exceptions.Exception



More information about the Python-list mailing list