add (Base)ExceptionGroup (#6655)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
This commit is contained in:
Jelle Zijlstra
2021-12-22 07:56:35 -08:00
committed by GitHub
parent 426ce065b2
commit b0453811ed

View File

@@ -1651,3 +1651,19 @@ class ResourceWarning(Warning): ...
if sys.version_info >= (3, 10):
class EncodingWarning(Warning): ...
if sys.version_info >= (3, 11):
_SplitCondition = type[BaseException] | tuple[type[BaseException, ...]] | Callable[[BaseException], bool]
class BaseExceptionGroup(BaseException):
def __new__(cls, __message: str, __exceptions: Sequence[BaseException]) -> BaseExceptionGroup | ExceptionGroup: ...
@property
def message(self) -> str: ...
@property
def exceptions(self) -> Sequence[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: ...
@property
def exceptions(self) -> Sequence[Exception]: ...