Skip to content

Commit

Permalink
pythongh-119287: clarify doc on BaseExceptionGroup.derive and link to…
Browse files Browse the repository at this point in the history
… it from contextlib.suppress
  • Loading branch information
iritkatriel committed May 28, 2024
1 parent b407ad3 commit dbcbdee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Doc/library/contextlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ 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. If any exceptions in the group are not suppressed, a group containing them
is re-raised (see also :meth:`~BaseExceptionGroup.derive`).

.. 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

0 comments on commit dbcbdee

Please sign in to comment.