From 7fbf9c7927ca9b75665b6416a3ac902758470c98 Mon Sep 17 00:00:00 2001 From: Max Muoto Date: Fri, 16 May 2025 22:50:00 -0500 Subject: [PATCH] Update exception group to match clinic generated arguments (#14088) --- stdlib/@tests/stubtest_allowlists/py314.txt | 4 ---- stdlib/builtins.pyi | 22 +++++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index c3058c955..7238a938f 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -26,10 +26,6 @@ asyncio.events._AbstractEventLoopPolicy asyncio.events._get_event_loop_policy asyncio.events._set_event_loop_policy asyncio.tasks.eager_task_factory -builtins.BaseExceptionGroup.split -builtins.BaseExceptionGroup.subgroup -builtins.ExceptionGroup.split -builtins.ExceptionGroup.subgroup builtins.bytearray.resize builtins.classmethod.__annotate__ builtins.classmethod.__class_getitem__ diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index ad6994cf6..caf208e5d 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -2160,27 +2160,27 @@ if sys.version_info >= (3, 11): def exceptions(self) -> tuple[_BaseExceptionT_co | BaseExceptionGroup[_BaseExceptionT_co], ...]: ... @overload def subgroup( - self, condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / + self, matcher_value: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / ) -> ExceptionGroup[_ExceptionT] | None: ... @overload def subgroup( - self, condition: type[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...], / + self, matcher_value: type[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...], / ) -> BaseExceptionGroup[_BaseExceptionT] | None: ... @overload def subgroup( - self, condition: Callable[[_BaseExceptionT_co | Self], bool], / + self, matcher_value: Callable[[_BaseExceptionT_co | Self], bool], / ) -> BaseExceptionGroup[_BaseExceptionT_co] | None: ... @overload def split( - self, condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / + self, matcher_value: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / ) -> tuple[ExceptionGroup[_ExceptionT] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]: ... @overload def split( - self, condition: type[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...], / + self, matcher_value: type[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...], / ) -> tuple[BaseExceptionGroup[_BaseExceptionT] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]: ... @overload def split( - self, condition: Callable[[_BaseExceptionT_co | Self], bool], / + self, matcher_value: Callable[[_BaseExceptionT_co | Self], bool], / ) -> tuple[BaseExceptionGroup[_BaseExceptionT_co] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]: ... # In reality it is `NonEmptySequence`: @overload @@ -2197,17 +2197,19 @@ if sys.version_info >= (3, 11): # We accept a narrower type, but that's OK. @overload # type: ignore[override] def subgroup( - self, condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / + self, matcher_value: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / ) -> ExceptionGroup[_ExceptionT] | None: ... @overload - def subgroup(self, condition: Callable[[_ExceptionT_co | Self], bool], /) -> ExceptionGroup[_ExceptionT_co] | None: ... + def subgroup( + self, matcher_value: Callable[[_ExceptionT_co | Self], bool], / + ) -> ExceptionGroup[_ExceptionT_co] | None: ... @overload # type: ignore[override] def split( - self, condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / + self, matcher_value: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / ) -> tuple[ExceptionGroup[_ExceptionT] | None, ExceptionGroup[_ExceptionT_co] | None]: ... @overload def split( - self, condition: Callable[[_ExceptionT_co | Self], bool], / + self, matcher_value: Callable[[_ExceptionT_co | Self], bool], / ) -> tuple[ExceptionGroup[_ExceptionT_co] | None, ExceptionGroup[_ExceptionT_co] | None]: ... if sys.version_info >= (3, 13):