Use TypeAlias where possible for type aliases (#7630)

This commit is contained in:
Alex Waygood
2022-04-16 02:01:00 +01:00
committed by GitHub
parent c0e6dd3f3f
commit 740193a8fc
218 changed files with 760 additions and 625 deletions

View File

@@ -1,7 +1,7 @@
import io
from _typeshed import ReadableBuffer, Self, StrOrBytesPath
from typing import IO, Any, Mapping, Sequence, TextIO, overload
from typing_extensions import Literal, final
from typing_extensions import Literal, TypeAlias, final
__all__ = [
"CHECK_NONE",
@@ -42,12 +42,12 @@ __all__ = [
"is_check_supported",
]
_OpenBinaryWritingMode = Literal["w", "wb", "x", "xb", "a", "ab"]
_OpenTextWritingMode = Literal["wt", "xt", "at"]
_OpenBinaryWritingMode: TypeAlias = Literal["w", "wb", "x", "xb", "a", "ab"]
_OpenTextWritingMode: TypeAlias = Literal["wt", "xt", "at"]
_PathOrFile = StrOrBytesPath | IO[bytes]
_PathOrFile: TypeAlias = StrOrBytesPath | IO[bytes]
_FilterChain = Sequence[Mapping[str, Any]]
_FilterChain: TypeAlias = Sequence[Mapping[str, Any]]
FORMAT_AUTO: Literal[0]
FORMAT_XZ: Literal[1]