From 143d57690e6cd662f680a3098bdfcc3b987e4964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Wed, 12 Jan 2022 01:02:08 +0200 Subject: [PATCH] Corrected (Base)ExceptionGroup names and types (#6895) The second argument to `ExceptionGroup` is positional-only. The `exceptions` property always returns a tuple, no matter what the type of the original `__exceptions` argument is. --- stdlib/builtins.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 1d6446b59..2e268e637 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1670,11 +1670,11 @@ if sys.version_info >= (3, 11): @property def message(self) -> str: ... @property - def exceptions(self) -> Sequence[BaseException]: ... + def exceptions(self) -> tuple[BaseException, ...]: ... def subgroup(self: Self, __condition: _SplitCondition) -> Self | None: ... def split(self: Self, __condition: _SplitCondition) -> tuple[Self | None, Self | None]: ... def derive(self: Self, __excs: Sequence[BaseException]) -> Self: ... class ExceptionGroup(BaseExceptionGroup, Exception): - def __new__(cls, __message: str, exceptions: Sequence[Exception]) -> ExceptionGroup: ... + def __new__(cls, __message: str, __exceptions: Sequence[Exception]) -> ExceptionGroup: ... @property - def exceptions(self) -> Sequence[Exception]: ... + def exceptions(self) -> tuple[Exception, ...]: ...