Skip to content

[3.13] gh-119287: clarify doc on BaseExceptionGroup.derive and link to it from contextlib.suppress (GH-119657) #120105

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

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion Doc/library/contextlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ Functions and classes provided:

If the code within the :keyword:`!with` block raises a
:exc:`BaseExceptionGroup`, suppressed exceptions are removed from the
group. If any exceptions in the group are not suppressed, a group containing them is re-raised.
group. Any exceptions of the group which are not suppressed are re-raised in
a new group which is created using the original group's :meth:`~BaseExceptionGroup.derive`
method.

.. versionadded:: 3.4

Expand Down
3 changes: 2 additions & 1 deletion Doc/library/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,8 @@ their subgroups based on the types of the contained exceptions.
Returns an exception group with the same :attr:`message`, but which
wraps the exceptions in ``excs``.

This method is used by :meth:`subgroup` and :meth:`split`. A
This method is used by :meth:`subgroup` and :meth:`split`, which
are used in various contexts to break up an exception group. A
subclass needs to override it in order to make :meth:`subgroup`
and :meth:`split` return instances of the subclass rather
than :exc:`ExceptionGroup`.
Expand Down
Loading