Remove several unused TypeVars (#6829)

This commit is contained in:
Alex Waygood
2022-01-05 15:58:03 +00:00
committed by GitHub
parent beedc1d039
commit 2268955701
7 changed files with 3 additions and 13 deletions

View File

@@ -2,7 +2,7 @@ import _compression
import sys
from _compression import BaseStream
from _typeshed import ReadableBuffer, Self, StrOrBytesPath, WriteableBuffer
from typing import IO, Any, Iterable, Protocol, TextIO, TypeVar, overload
from typing import IO, Any, Iterable, Protocol, TextIO, overload
from typing_extensions import Literal, SupportsIndex, final
# The following attributes and methods are optional:
@@ -16,8 +16,6 @@ class _WritableFileobj(Protocol):
# def fileno(self) -> int: ...
# def close(self) -> object: ...
_T = TypeVar("_T")
def compress(data: bytes, compresslevel: int = ...) -> bytes: ...
def decompress(data: bytes) -> bytes: ...

View File

@@ -1,7 +1,7 @@
import types
from _typeshed import StrPath
from os import PathLike
from typing import IO, Any, Protocol, TypeVar
from typing import IO, Any, Protocol
from _imp import (
acquire_lock as acquire_lock,
@@ -15,8 +15,6 @@ from _imp import (
release_lock as release_lock,
)
_T = TypeVar("_T")
SEARCH_ERROR: int
PY_SOURCE: int
PY_COMPILED: int

View File

@@ -9,7 +9,6 @@ if sys.version_info >= (3, 9):
__all__ = ["Pool", "ThreadPool"]
_PT = TypeVar("_PT", bound=Pool)
_S = TypeVar("_S")
_T = TypeVar("_T")

View File

@@ -2,9 +2,8 @@ import sys
import types
from _typeshed import Self
from socket import socket as _socket
from typing import Any, BinaryIO, Callable, ClassVar, Type, TypeVar, Union
from typing import Any, BinaryIO, Callable, ClassVar, Type, Union
_T = TypeVar("_T")
_RequestType = Union[_socket, tuple[bytes, _socket]]
_AddressType = Union[tuple[str, int], str]

View File

@@ -25,7 +25,6 @@ from typing_extensions import Literal, ParamSpec, final
# Note, all classes "defined" here require special handling.
_T = TypeVar("_T")
_T1 = TypeVar("_T1")
_T2 = TypeVar("_T2")
_T_co = TypeVar("_T_co", covariant=True)

View File

@@ -11,7 +11,6 @@ from _weakref import (
ref as ref,
)
_S = TypeVar("_S")
_T = TypeVar("_T")
_KT = TypeVar("_KT")
_VT = TypeVar("_VT")

View File

@@ -23,8 +23,6 @@ from .connection import ConnectionPool
from .lock import Lock
from .retry import Retry
_ScoreCastFuncReturn = TypeVar("_ScoreCastFuncReturn")
_Value = Union[bytes, float, int, str]
_Key = Union[str, bytes]