Skip to content

Commit 143d576

Browse files
authored
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.
1 parent 3101849 commit 143d576

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/builtins.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,11 +1670,11 @@ if sys.version_info >= (3, 11):
16701670
@property
16711671
def message(self) -> str: ...
16721672
@property
1673-
def exceptions(self) -> Sequence[BaseException]: ...
1673+
def exceptions(self) -> tuple[BaseException, ...]: ...
16741674
def subgroup(self: Self, __condition: _SplitCondition) -> Self | None: ...
16751675
def split(self: Self, __condition: _SplitCondition) -> tuple[Self | None, Self | None]: ...
16761676
def derive(self: Self, __excs: Sequence[BaseException]) -> Self: ...
16771677
class ExceptionGroup(BaseExceptionGroup, Exception):
1678-
def __new__(cls, __message: str, exceptions: Sequence[Exception]) -> ExceptionGroup: ...
1678+
def __new__(cls, __message: str, __exceptions: Sequence[Exception]) -> ExceptionGroup: ...
16791679
@property
1680-
def exceptions(self) -> Sequence[Exception]: ...
1680+
def exceptions(self) -> tuple[Exception, ...]: ...

0 commit comments

Comments
 (0)