'Why is it recommended to derive from Exception instead of BaseException class in Python?
The Python 2 documentation says that "programmers are encouraged to derive new exceptions from the Exception class or one of its subclasses, and not from BaseException". Without any further explanation as to why.
I am curious as to why it is recommended this way? Is it just to preserve the exceptions hierarchy as Python developers envisioned it?
>>> dir(BaseException) == dir(Exception)
True
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
