Skip to content

bpo-45464: Add a warning about subclassing built-in exceptions #28995

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Doc/library/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ In either case, the exception itself is always shown after any chained
exceptions so that the final line of the traceback always shows the last
exception that was raised.

.. warning:: Creating a subclass that inherits from multiple exceptions may not
Copy link
Contributor

@ambv ambv Oct 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally avoid warning boxes on docs.python.org, instead opting for a more affirmative documentation style. See here: https://devguide.python.org/documenting/#affirmative-tone

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still prefer the warning because I think this should have more visibility and he have done this in the past for exactly this reason. In any case, I am happy to take a suggestion on how to make this more affirmative while keeping it visible.

work and the potential conflicts may change in new versions.

Base classes
------------
Expand Down