mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Always import Protocol from typing in stubs (#6617)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
# Stub-only types. This module does not exist at runtime.
|
||||
|
||||
from typing import Any
|
||||
from typing_extensions import Protocol
|
||||
from typing import Any, Protocol
|
||||
|
||||
# As defined https://docs.python.org/3/library/xml.dom.html#domimplementation-objects
|
||||
class DOMImplementation(Protocol):
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, Callable, ContextManager, Iterable, Iterator, Optional, Type, TypeVar
|
||||
from typing_extensions import Protocol
|
||||
from typing import IO, Any, Callable, ContextManager, Iterable, Iterator, Optional, Protocol, Type, TypeVar
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# See the README.md file in this directory for more information.
|
||||
|
||||
from typing import Any
|
||||
from typing_extensions import Protocol
|
||||
from typing import Any, Protocol
|
||||
|
||||
# As defined https://docs.python.org/3/library/xml.dom.html#domimplementation-objects
|
||||
class DOMImplementation(Protocol):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from socket import socket
|
||||
from typing import Any, Mapping, Type
|
||||
from typing_extensions import Literal, Protocol
|
||||
from typing import Any, Mapping, Protocol, Type
|
||||
from typing_extensions import Literal
|
||||
|
||||
from . import base_events, constants, events, futures, streams, transports
|
||||
|
||||
|
||||
@@ -11,11 +11,12 @@ from typing import (
|
||||
Generic,
|
||||
Iterator,
|
||||
Optional,
|
||||
Protocol,
|
||||
Type,
|
||||
TypeVar,
|
||||
overload,
|
||||
)
|
||||
from typing_extensions import ParamSpec, Protocol
|
||||
from typing_extensions import ParamSpec
|
||||
|
||||
AbstractContextManager = ContextManager
|
||||
if sys.version_info >= (3, 7):
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import sys
|
||||
import types
|
||||
from typing import Any, Callable, Generic, Iterable, Mapping, Tuple, Type, TypeVar, overload
|
||||
from typing_extensions import Protocol
|
||||
from typing import Any, Callable, Generic, Iterable, Mapping, Protocol, Tuple, Type, TypeVar, overload
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import threading
|
||||
from types import TracebackType
|
||||
from typing import Iterator, Type
|
||||
from typing_extensions import Literal, Protocol
|
||||
from typing import Iterator, Protocol, Type
|
||||
from typing_extensions import Literal
|
||||
|
||||
__version__: str
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from types import TracebackType
|
||||
from typing import Any, ClassVar, Type
|
||||
from typing_extensions import Protocol
|
||||
from typing import Any, ClassVar, Protocol, Type
|
||||
|
||||
from redis.client import Redis
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from _typeshed import SupportsItems
|
||||
from typing import Any, Iterable, Iterator, TypeVar
|
||||
from typing_extensions import Protocol
|
||||
from typing import Any, Iterable, Iterator, Protocol, TypeVar
|
||||
|
||||
_KT_co = TypeVar("_KT_co", covariant=True)
|
||||
_VT_co = TypeVar("_VT_co", covariant=True)
|
||||
|
||||
Reference in New Issue
Block a user