From 425ba77bb29105473adf516d349ae69fc21f28cd Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sun, 16 Jan 2022 16:07:32 +0000 Subject: [PATCH] Remove even more unused `TypeVar`s (#6928) --- stdlib/@python2/__builtin__.pyi | 1 - stdlib/@python2/_dummy_threading.pyi | 3 +-- stdlib/@python2/builtins.pyi | 1 - stdlib/@python2/cgi.pyi | 4 +--- stdlib/@python2/contextlib.pyi | 2 -- stdlib/@python2/ftplib.pyi | 3 +-- stdlib/@python2/multiprocessing/pool.pyi | 4 +--- stdlib/@python2/socket.pyi | 3 +-- stdlib/@python2/threading.pyi | 1 - stdlib/@python2/weakref.pyi | 1 - 10 files changed, 5 insertions(+), 18 deletions(-) diff --git a/stdlib/@python2/__builtin__.pyi b/stdlib/@python2/__builtin__.pyi index 69edcca47..45eee82cc 100644 --- a/stdlib/@python2/__builtin__.pyi +++ b/stdlib/@python2/__builtin__.pyi @@ -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 diff --git a/stdlib/@python2/_dummy_threading.pyi b/stdlib/@python2/_dummy_threading.pyi index e45a1b5c4..48f5b6d6d 100644 --- a/stdlib/@python2/_dummy_threading.pyi +++ b/stdlib/@python2/_dummy_threading.pyi @@ -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] diff --git a/stdlib/@python2/builtins.pyi b/stdlib/@python2/builtins.pyi index 69edcca47..45eee82cc 100644 --- a/stdlib/@python2/builtins.pyi +++ b/stdlib/@python2/builtins.pyi @@ -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 diff --git a/stdlib/@python2/cgi.pyi b/stdlib/@python2/cgi.pyi index 674748242..2817c3639 100644 --- a/stdlib/@python2/cgi.pyi +++ b/stdlib/@python2/cgi.pyi @@ -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] = ..., diff --git a/stdlib/@python2/contextlib.pyi b/stdlib/@python2/contextlib.pyi index 6782fbf18..673cdc434 100644 --- a/stdlib/@python2/contextlib.pyi +++ b/stdlib/@python2/contextlib.pyi @@ -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: ... diff --git a/stdlib/@python2/ftplib.pyi b/stdlib/@python2/ftplib.pyi index 0931a9d17..1149d4549 100644 --- a/stdlib/@python2/ftplib.pyi +++ b/stdlib/@python2/ftplib.pyi @@ -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 diff --git a/stdlib/@python2/multiprocessing/pool.pyi b/stdlib/@python2/multiprocessing/pool.pyi index be9747e89..27c0cb1d9 100644 --- a/stdlib/@python2/multiprocessing/pool.pyi +++ b/stdlib/@python2/multiprocessing/pool.pyi @@ -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: ... diff --git a/stdlib/@python2/socket.pyi b/stdlib/@python2/socket.pyi index 2bf719dd9..fe77c7283 100644 --- a/stdlib/@python2/socket.pyi +++ b/stdlib/@python2/socket.pyi @@ -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 diff --git a/stdlib/@python2/threading.pyi b/stdlib/@python2/threading.pyi index e45a1b5c4..dac7e414d 100644 --- a/stdlib/@python2/threading.pyi +++ b/stdlib/@python2/threading.pyi @@ -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] diff --git a/stdlib/@python2/weakref.pyi b/stdlib/@python2/weakref.pyi index 6467f3a75..da380dcd2 100644 --- a/stdlib/@python2/weakref.pyi +++ b/stdlib/@python2/weakref.pyi @@ -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")