Suffix T to type variable names (#4898)

* _MessageType to _MessageT

* _default to _T

* _TConnection to _ConnectionT, _TListener to _ListenerT

* _Number to _NumberT

* _MessageVar to _MessageT

* _Type to _TypeT

* _ArgType to _T

* _Ch to _CharT

Co-authored-by: hauntsaninja <>
This commit is contained in:
Shantanu
2021-01-04 00:03:32 -08:00
committed by GitHub
parent bc1fe548b9
commit 484c014665
9 changed files with 62 additions and 62 deletions

View File

@@ -1,16 +1,16 @@
from typing import Any, Callable, Hashable, List, Optional, SupportsInt, Tuple, TypeVar, Union
_Type = TypeVar("_Type", bound=type)
_Reduce = Union[Tuple[Callable[..., _Type], Tuple[Any, ...]], Tuple[Callable[..., _Type], Tuple[Any, ...], Optional[Any]]]
_TypeT = TypeVar("_TypeT", bound=type)
_Reduce = Union[Tuple[Callable[..., _TypeT], Tuple[Any, ...]], Tuple[Callable[..., _TypeT], Tuple[Any, ...], Optional[Any]]]
__all__: List[str]
def pickle(
ob_type: _Type,
pickle_function: Callable[[_Type], Union[str, _Reduce[_Type]]],
constructor_ob: Optional[Callable[[_Reduce[_Type]], _Type]] = ...,
ob_type: _TypeT,
pickle_function: Callable[[_TypeT], Union[str, _Reduce[_TypeT]]],
constructor_ob: Optional[Callable[[_Reduce[_TypeT]], _TypeT]] = ...,
) -> None: ...
def constructor(object: Callable[[_Reduce[_Type]], _Type]) -> None: ...
def constructor(object: Callable[[_Reduce[_TypeT]], _TypeT]) -> None: ...
def add_extension(module: Hashable, name: Hashable, code: SupportsInt) -> None: ...
def remove_extension(module: Hashable, name: Hashable, code: int) -> None: ...
def clear_extension_cache() -> None: ...

View File

@@ -1,6 +1,6 @@
from typing import Any, Callable, Deque, TypeVar
_ArgType = TypeVar("_ArgType")
_T = TypeVar("_T")
class mutex:
locked: bool
@@ -8,5 +8,5 @@ class mutex:
def __init__(self) -> None: ...
def test(self) -> bool: ...
def testandset(self) -> bool: ...
def lock(self, function: Callable[[_ArgType], Any], argument: _ArgType) -> None: ...
def lock(self, function: Callable[[_T], Any], argument: _T) -> None: ...
def unlock(self) -> None: ...