Re: StandardError in Python 2 -> 3

2012-11-16 Thread Ian Kelly
On Fri, Nov 16, 2012 at 6:30 PM, Steven D'Aprano 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

StandardError in Python 2 -> 3

2012-11-16 Thread Steven D'Aprano
The exception hierarchy in Python 3 is shallower than in Python 2. Here is a partial list of exceptions in Python 2: BaseException +-- SystemExit +-- KeyboardInterrupt +-- GeneratorExit +-- Exception +-- StandardError |+-- AttributeError |+-- ImportError |