Remove even more unused TypeVars (#6928)

This commit is contained in:
Alex Waygood
2022-01-16 16:07:32 +00:00
committed by GitHub
parent dbcb38a605
commit 425ba77bb2
10 changed files with 5 additions and 18 deletions

View File

@@ -61,7 +61,6 @@ _T3 = TypeVar("_T3")
_T4 = TypeVar("_T4")
_T5 = TypeVar("_T5")
_TT = TypeVar("_TT", bound="type")
_TBE = TypeVar("_TBE", bound="BaseException")
class object:
__doc__: str | None

View File

@@ -1,11 +1,10 @@
from types import FrameType, TracebackType
from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Type, TypeVar
from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Type
# TODO recursive type
_TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]]
_PF = Callable[[FrameType, str, Any], None]
_T = TypeVar("_T")
__all__: List[str]

View File

@@ -61,7 +61,6 @@ _T3 = TypeVar("_T3")
_T4 = TypeVar("_T4")
_T5 = TypeVar("_T5")
_TT = TypeVar("_TT", bound="type")
_TBE = TypeVar("_TBE", bound="BaseException")
class object:
__doc__: str | None

View File

@@ -1,10 +1,8 @@
from _typeshed import SupportsGetItem, SupportsItemAccess
from builtins import type as _type
from typing import IO, Any, AnyStr, Iterable, Iterator, List, Mapping, Protocol, TypeVar
from typing import IO, Any, AnyStr, Iterable, Iterator, List, Mapping, Protocol
from UserDict import UserDict
_T = TypeVar("_T", bound=FieldStorage)
def parse(
fp: IO[Any] | None = ...,
environ: SupportsItemAccess[str, str] = ...,

View File

@@ -3,11 +3,9 @@ from typing import IO, Any, Callable, ContextManager, Iterable, Iterator, Option
_T = TypeVar("_T")
_T_co = TypeVar("_T_co", covariant=True)
_T_io = TypeVar("_T_io", bound=Optional[IO[str]])
_F = TypeVar("_F", bound=Callable[..., Any])
_ExitFunc = Callable[[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]], bool]
_CM_EF = TypeVar("_CM_EF", ContextManager[Any], _ExitFunc)
class GeneratorContextManager(ContextManager[_T_co]):
def __call__(self, func: _F) -> _F: ...

View File

@@ -1,10 +1,9 @@
from _typeshed import SupportsRead, SupportsReadline
from socket import socket
from ssl import SSLContext
from typing import Any, BinaryIO, Callable, List, Text, Tuple, Type, TypeVar, Union
from typing import Any, BinaryIO, Callable, List, Text, Tuple, Type, Union
from typing_extensions import Literal
_T = TypeVar("_T")
_IntOrStr = Union[int, Text]
MSG_OOB: int

View File

@@ -1,6 +1,4 @@
from typing import Any, Callable, Dict, Iterable, Iterator, List, TypeVar
_T = TypeVar("_T", bound=Pool)
from typing import Any, Callable, Dict, Iterable, Iterator, List
class AsyncResult:
def get(self, timeout: float | None = ...) -> Any: ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, BinaryIO, Iterable, List, Text, Tuple, TypeVar, Union, overload
from typing import Any, BinaryIO, Iterable, List, Text, Tuple, Union, overload
# ----- Constants -----
# Some socket families are listed in the "Socket families" section of the docs,
@@ -380,7 +380,6 @@ _RetAddress = Any
_WriteBuffer = Union[bytearray, memoryview]
_CMSG = Tuple[int, int, bytes]
_SelfT = TypeVar("_SelfT", bound=socket)
class socket:
family: int

View File

@@ -5,7 +5,6 @@ from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Type,
_TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]]
_PF = Callable[[FrameType, str, Any], None]
_T = TypeVar("_T")
__all__: List[str]

View File

@@ -12,7 +12,6 @@ from _weakref import (
)
from exceptions import ReferenceError as ReferenceError
_S = TypeVar("_S")
_T = TypeVar("_T")
_KT = TypeVar("_KT")
_VT = TypeVar("_VT")