Update typing_extensions imports in stdlib (#11244)

Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
This commit is contained in:
Sebastian Rittau
2024-01-05 17:15:19 +01:00
committed by GitHub
parent b6eaadcfe5
commit 53a8193d64
214 changed files with 365 additions and 430 deletions

View File

@@ -5,8 +5,8 @@ from collections.abc import Callable, Iterable, Iterator
from io import TextIOWrapper
from os import PathLike
from types import TracebackType
from typing import IO, Protocol, overload
from typing_extensions import Literal, Self, TypeAlias
from typing import IO, Literal, Protocol, overload
from typing_extensions import Self, TypeAlias
__all__ = [
"BadZipFile",
@@ -24,12 +24,13 @@ __all__ = [
"LargeZipFile",
]
# TODO: use TypeAlias when mypy bugs are fixed
# TODO: use TypeAlias for these two when mypy bugs are fixed
# https://github.com/python/mypy/issues/16581
_DateTuple = tuple[int, int, int, int, int, int] # noqa: Y026
_ZipFileMode = Literal["r", "w", "x", "a"] # noqa: Y026
_ReadWriteMode: TypeAlias = Literal["r", "w"]
_ReadWriteBinaryMode: TypeAlias = Literal["r", "w", "rb", "wb"]
_ZipFileMode: TypeAlias = Literal["r", "w", "x", "a"]
class BadZipFile(Exception): ...

View File

@@ -3,8 +3,8 @@ from _typeshed import StrPath
from collections.abc import Iterator, Sequence
from io import TextIOWrapper
from os import PathLike
from typing import IO, overload
from typing_extensions import Literal, Self, TypeAlias
from typing import IO, Literal, overload
from typing_extensions import Self, TypeAlias
from zipfile import ZipFile
_ReadWriteBinaryMode: TypeAlias = Literal["r", "w", "rb", "wb"]