mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-28 06:36:54 +08:00
Update typing_extensions imports in stdlib (#11244)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
This commit is contained in:
@@ -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): ...
|
||||
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user