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

gh-119287: clarify doc on BaseExceptionGroup.derive and link to it from contextlib.suppress (GH-119657)
(cherry picked from commit 5c02ea8bae)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2024-06-05 14:15:51 +02:00 committed by GitHub
parent 71f86eedeb
commit 8e0c80a486
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -314,7 +314,9 @@ Functions and classes provided:
If the code within the :keyword:`!with` block raises a If the code within the :keyword:`!with` block raises a
:exc:`BaseExceptionGroup`, suppressed exceptions are removed from the :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 .. versionadded:: 3.4

View File

@ -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 Returns an exception group with the same :attr:`message`, but which
wraps the exceptions in ``excs``. 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` subclass needs to override it in order to make :meth:`subgroup`
and :meth:`split` return instances of the subclass rather and :meth:`split` return instances of the subclass rather
than :exc:`ExceptionGroup`. than :exc:`ExceptionGroup`.