Use TypeAlias where possible for type aliases (#7630)

This commit is contained in:
Alex Waygood
2022-04-15 18:01:00 -07:00
committed by GitHub
parent c0e6dd3f3f
commit 740193a8fc
218 changed files with 760 additions and 625 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
from _warnings import warn as warn, warn_explicit as warn_explicit
from types import ModuleType, TracebackType
from typing import Any, Sequence, TextIO, overload
from typing_extensions import Literal
from typing_extensions import Literal, TypeAlias
__all__ = [
"warn",
@@ -14,7 +14,7 @@ __all__ = [
"catch_warnings",
]
_ActionKind = Literal["default", "error", "ignore", "always", "module", "once"]
_ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "module", "once"]
filters: Sequence[tuple[str, str | None, type[Warning], str | None, int]] # undocumented, do not mutate