mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Update typing_extensions imports in stdlib (#11244)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
This commit is contained in:
@@ -10,8 +10,8 @@ from asyncio.transports import BaseTransport, DatagramTransport, ReadTransport,
|
||||
from collections.abc import Callable, Iterable, Sequence
|
||||
from contextvars import Context
|
||||
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
|
||||
from typing import IO, Any, TypeVar, overload
|
||||
from typing_extensions import Literal, TypeAlias, TypeVarTuple, Unpack
|
||||
from typing import IO, Any, Literal, TypeVar, overload
|
||||
from typing_extensions import TypeAlias, TypeVarTuple, Unpack
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
__all__ = ("BaseEventLoop", "Server")
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from collections.abc import Callable, Sequence
|
||||
from contextvars import Context
|
||||
from typing import Any
|
||||
from typing_extensions import Literal
|
||||
from typing import Any, Literal
|
||||
|
||||
from . import futures
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import enum
|
||||
import sys
|
||||
from typing_extensions import Literal
|
||||
from typing import Literal
|
||||
|
||||
LOG_THRESHOLD_FOR_CONNLOST_WRITES: Literal[5]
|
||||
ACCEPT_RETRY_DELAY: Literal[1]
|
||||
|
||||
@@ -5,8 +5,8 @@ from abc import ABCMeta, abstractmethod
|
||||
from collections.abc import Callable, Coroutine, Generator, Sequence
|
||||
from contextvars import Context
|
||||
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
|
||||
from typing import IO, Any, Protocol, TypeVar, overload
|
||||
from typing_extensions import Literal, Self, TypeAlias, TypeVarTuple, Unpack, deprecated
|
||||
from typing import IO, Any, Literal, Protocol, TypeVar, overload
|
||||
from typing_extensions import Self, TypeAlias, TypeVarTuple, Unpack, deprecated
|
||||
|
||||
from . import _AwaitableLike, _CoroutineLike
|
||||
from .base_events import Server
|
||||
|
||||
@@ -2,8 +2,8 @@ import sys
|
||||
from collections.abc import Awaitable, Callable, Generator, Iterable
|
||||
from concurrent.futures._base import Future as _ConcurrentFuture
|
||||
from contextvars import Context
|
||||
from typing import Any, TypeVar
|
||||
from typing_extensions import Literal, Self, TypeGuard
|
||||
from typing import Any, Literal, TypeVar
|
||||
from typing_extensions import Self, TypeGuard
|
||||
|
||||
from .events import AbstractEventLoop
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ from _typeshed import Unused
|
||||
from collections import deque
|
||||
from collections.abc import Callable, Generator
|
||||
from types import TracebackType
|
||||
from typing import Any, TypeVar
|
||||
from typing_extensions import Literal, Self
|
||||
from typing import Any, Literal, TypeVar
|
||||
from typing_extensions import Self
|
||||
|
||||
from .events import AbstractEventLoop
|
||||
from .futures import Future
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import sys
|
||||
from collections.abc import Mapping
|
||||
from socket import socket
|
||||
from typing import Any, ClassVar
|
||||
from typing_extensions import Literal
|
||||
from typing import Any, ClassVar, Literal
|
||||
|
||||
from . import base_events, constants, events, futures, streams, transports
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import sys
|
||||
from _typeshed import Unused
|
||||
from collections.abc import Callable, Coroutine
|
||||
from contextvars import Context
|
||||
from typing import Any, TypeVar
|
||||
from typing_extensions import Self, final
|
||||
from typing import Any, TypeVar, final
|
||||
from typing_extensions import Self
|
||||
|
||||
from .events import AbstractEventLoop
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import sys
|
||||
from collections import deque
|
||||
from collections.abc import Callable
|
||||
from enum import Enum
|
||||
from typing import Any, ClassVar
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
from typing import Any, ClassVar, Literal
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from . import constants, events, futures, protocols, transports
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import ssl
|
||||
import sys
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Sequence
|
||||
from typing import Any
|
||||
from typing_extensions import Self, SupportsIndex, TypeAlias
|
||||
from typing import Any, SupportsIndex
|
||||
from typing_extensions import Self, TypeAlias
|
||||
|
||||
from . import events, protocols, transports
|
||||
from .base_events import Server
|
||||
|
||||
@@ -3,8 +3,7 @@ import sys
|
||||
from _typeshed import StrOrBytesPath
|
||||
from asyncio import events, protocols, streams, transports
|
||||
from collections.abc import Callable, Collection
|
||||
from typing import IO, Any
|
||||
from typing_extensions import Literal
|
||||
from typing import IO, Any, Literal
|
||||
|
||||
__all__ = ("create_subprocess_exec", "create_subprocess_shell")
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import concurrent.futures
|
||||
import sys
|
||||
from collections.abc import Awaitable, Coroutine, Generator, Iterable, Iterator
|
||||
from types import FrameType
|
||||
from typing import Any, Protocol, TextIO, TypeVar, overload
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
from typing import Any, Literal, Protocol, TextIO, TypeVar, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from . import _CoroutineLike
|
||||
from .events import AbstractEventLoop
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from types import TracebackType
|
||||
from typing_extensions import Self, final
|
||||
from typing import final
|
||||
from typing_extensions import Self
|
||||
|
||||
__all__ = ("Timeout", "timeout", "timeout_at")
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@ import sys
|
||||
import types
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from collections.abc import Callable
|
||||
from typing_extensions import Literal, Self, TypeVarTuple, Unpack, deprecated
|
||||
from typing import Literal
|
||||
from typing_extensions import Self, TypeVarTuple, Unpack, deprecated
|
||||
|
||||
from .events import AbstractEventLoop, BaseDefaultEventLoopPolicy
|
||||
from .selector_events import BaseSelectorEventLoop
|
||||
|
||||
@@ -2,8 +2,7 @@ import socket
|
||||
import sys
|
||||
from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer
|
||||
from collections.abc import Callable
|
||||
from typing import IO, Any, ClassVar, NoReturn
|
||||
from typing_extensions import Literal
|
||||
from typing import IO, Any, ClassVar, Literal, NoReturn
|
||||
|
||||
from . import events, futures, proactor_events, selector_events, streams, windows_utils
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import subprocess
|
||||
import sys
|
||||
from collections.abc import Callable
|
||||
from types import TracebackType
|
||||
from typing import Any, AnyStr
|
||||
from typing_extensions import Literal, Self
|
||||
from typing import Any, AnyStr, Literal
|
||||
from typing_extensions import Self
|
||||
|
||||
if sys.platform == "win32":
|
||||
__all__ = ("pipe", "Popen", "PIPE", "PipeHandle")
|
||||
|
||||
Reference in New Issue
Block a user