From 72c6ff7268b488bd7273e268a638131482f8d944 Mon Sep 17 00:00:00 2001 From: Jonathan Dung Date: Sun, 24 May 2026 18:45:28 +0800 Subject: [PATCH 1/4] commit --- stdlib/warnings.pyi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/stdlib/warnings.pyi b/stdlib/warnings.pyi index da281e38ddd0..d44fa516c466 100644 --- a/stdlib/warnings.pyi +++ b/stdlib/warnings.pyi @@ -27,7 +27,7 @@ if sys.version_info >= (3, 14): _ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "module", "once"] else: _ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "all", "module", "once"] -filters: Sequence[tuple[str, re.Pattern[str] | None, type[Warning], re.Pattern[str] | None, int]] # undocumented, do not mutate +filters: Sequence[tuple[str, re.Pattern[str] | None, type[Warning] | tuple[type[Warning], ...], re.Pattern[str] | None, int]] # undocumented, do not mutate def showwarning( message: Warning | str, @@ -41,9 +41,9 @@ def formatwarning( message: Warning | str, category: type[Warning], filename: str, lineno: int, line: str | None = None ) -> str: ... def filterwarnings( - action: _ActionKind, message: str = "", category: type[Warning] = ..., module: str = "", lineno: int = 0, append: bool = False + action: _ActionKind, message: str = "", category: type[Warning] | tuple[type[Warning], ...] = ..., module: str = "", lineno: int = 0, append: bool = False ) -> None: ... -def simplefilter(action: _ActionKind, category: type[Warning] = ..., lineno: int = 0, append: bool = False) -> None: ... +def simplefilter(action: _ActionKind, category: type[Warning] | tuple[type[Warning], ...] = ..., lineno: int = 0, append: bool = False) -> None: ... def resetwarnings() -> None: ... class _OptionError(Exception): ... @@ -92,7 +92,7 @@ class catch_warnings(Generic[_W_co]): record: Literal[False] = False, module: ModuleType | None = None, action: _ActionKind | None = None, - category: type[Warning] = ..., + category: type[Warning] | tuple[type[Warning], ...] = ..., lineno: int = 0, append: bool = False, ) -> None: ... @@ -103,7 +103,7 @@ class catch_warnings(Generic[_W_co]): record: Literal[True], module: ModuleType | None = None, action: _ActionKind | None = None, - category: type[Warning] = ..., + category: type[Warning] | tuple[type[Warning], ...] = ..., lineno: int = 0, append: bool = False, ) -> None: ... @@ -114,7 +114,7 @@ class catch_warnings(Generic[_W_co]): record: bool, module: ModuleType | None = None, action: _ActionKind | None = None, - category: type[Warning] = ..., + category: type[Warning] | tuple[type[Warning], ...] = ..., lineno: int = 0, append: bool = False, ) -> None: ... From 9e3e2d5c1f56d3b2d347c5b9a7a9e3dbf33eccd7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 24 May 2026 10:48:58 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/warnings.pyi | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/stdlib/warnings.pyi b/stdlib/warnings.pyi index d44fa516c466..3e59d875abae 100644 --- a/stdlib/warnings.pyi +++ b/stdlib/warnings.pyi @@ -27,7 +27,9 @@ if sys.version_info >= (3, 14): _ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "module", "once"] else: _ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "all", "module", "once"] -filters: Sequence[tuple[str, re.Pattern[str] | None, type[Warning] | tuple[type[Warning], ...], re.Pattern[str] | None, int]] # undocumented, do not mutate +filters: Sequence[ + tuple[str, re.Pattern[str] | None, type[Warning] | tuple[type[Warning], ...], re.Pattern[str] | None, int] +] # undocumented, do not mutate def showwarning( message: Warning | str, @@ -41,9 +43,16 @@ def formatwarning( message: Warning | str, category: type[Warning], filename: str, lineno: int, line: str | None = None ) -> str: ... def filterwarnings( - action: _ActionKind, message: str = "", category: type[Warning] | tuple[type[Warning], ...] = ..., module: str = "", lineno: int = 0, append: bool = False + action: _ActionKind, + message: str = "", + category: type[Warning] | tuple[type[Warning], ...] = ..., + module: str = "", + lineno: int = 0, + append: bool = False, +) -> None: ... +def simplefilter( + action: _ActionKind, category: type[Warning] | tuple[type[Warning], ...] = ..., lineno: int = 0, append: bool = False ) -> None: ... -def simplefilter(action: _ActionKind, category: type[Warning] | tuple[type[Warning], ...] = ..., lineno: int = 0, append: bool = False) -> None: ... def resetwarnings() -> None: ... class _OptionError(Exception): ... From f8b505d4edb53d353517c52c05d16758e75b9293 Mon Sep 17 00:00:00 2001 From: Jonathan Dung Date: Sun, 24 May 2026 19:04:44 +0800 Subject: [PATCH 3/4] commit 3 --- stdlib/warnings.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/warnings.pyi b/stdlib/warnings.pyi index 3e59d875abae..70d449b01e88 100644 --- a/stdlib/warnings.pyi +++ b/stdlib/warnings.pyi @@ -45,7 +45,7 @@ def formatwarning( def filterwarnings( action: _ActionKind, message: str = "", - category: type[Warning] | tuple[type[Warning], ...] = ..., + category: type[Warning] = ..., module: str = "", lineno: int = 0, append: bool = False, From abdfdc3358bbc0288e9f67cbc46ab9430924688a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 24 May 2026 11:06:38 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/warnings.pyi | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/stdlib/warnings.pyi b/stdlib/warnings.pyi index 70d449b01e88..e17b6e3a25b3 100644 --- a/stdlib/warnings.pyi +++ b/stdlib/warnings.pyi @@ -43,12 +43,7 @@ def formatwarning( message: Warning | str, category: type[Warning], filename: str, lineno: int, line: str | None = None ) -> str: ... def filterwarnings( - action: _ActionKind, - message: str = "", - category: type[Warning] = ..., - module: str = "", - lineno: int = 0, - append: bool = False, + action: _ActionKind, message: str = "", category: type[Warning] = ..., module: str = "", lineno: int = 0, append: bool = False ) -> None: ... def simplefilter( action: _ActionKind, category: type[Warning] | tuple[type[Warning], ...] = ..., lineno: int = 0, append: bool = False