New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify recommendation to inherit from Exception #64823
Comments
From http://docs.python.org/3.4/library/exceptions.html: "... programmers are encouraged to at least derive new exceptions from the Exception class and not BaseException." This wording had someone I've talked to recently thinking that user-defined exceptions should inherit *directly* from Exception. Suggested rewording, dropping the "at least" qualification that as far as I can tell serves no real purpose: "... programmers are encouraged to derive new exceptions from the Exception class or one of its subclasses, and not from BaseException." |
In my reading “at least” means that exceptions should derive from Exception if they don’t derive from a more specific subclass. IOW the same meaning as your proposed wording, but less clear. +1 to your rewording. |
New changeset 8dc1b45bd467 by Mark Dickinson in branch '3.4': New changeset 262204877004 by Mark Dickinson in branch 'default': |
New changeset f729a0e90c4f by Mark Dickinson in branch '2.7': |
Fixed. Closing. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: