From 3a48a1298ffc22d47ede28ec8db75b73c93fb2e9 Mon Sep 17 00:00:00 2001 From: "Aaron Z." <40212329+aaronzo@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:11:22 +0100 Subject: [PATCH] Fix `warnings.filters` type (#12866) Fixes #12828 --- stdlib/warnings.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/warnings.pyi b/stdlib/warnings.pyi index c7ab1cb09..fa37018b5 100644 --- a/stdlib/warnings.pyi +++ b/stdlib/warnings.pyi @@ -1,4 +1,5 @@ import sys +import re from _warnings import warn as warn, warn_explicit as warn_explicit from collections.abc import Sequence from types import ModuleType, TracebackType @@ -25,7 +26,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, str | None, type[Warning], str | None, int]] # undocumented, do not mutate +filters: Sequence[tuple[str, re.Pattern[str] | None, type[Warning], re.Pattern[str] | None, int]] # undocumented, do not mutate def showwarning( message: Warning | str,