Move IdentityFunction to _typeshed (#5483)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Sebastian Rittau
2021-05-17 12:04:35 +02:00
committed by GitHub
parent 02be4b5da2
commit 7a9a107a63
3 changed files with 20 additions and 14 deletions

View File

@@ -22,9 +22,13 @@ _KT_co = TypeVar("_KT_co", covariant=True)
_KT_contra = TypeVar("_KT_contra", contravariant=True)
_VT = TypeVar("_VT")
_VT_co = TypeVar("_VT_co", covariant=True)
_T = TypeVar("_T")
_T_co = TypeVar("_T_co", covariant=True)
_T_contra = TypeVar("_T_contra", contravariant=True)
class IdentityFunction(Protocol):
def __call__(self, __x: _T) -> _T: ...
class SupportsLessThan(Protocol):
def __lt__(self, __other: Any) -> bool: ...

View File

@@ -24,9 +24,13 @@ _KT_co = TypeVar("_KT_co", covariant=True)
_KT_contra = TypeVar("_KT_contra", contravariant=True)
_VT = TypeVar("_VT")
_VT_co = TypeVar("_VT_co", covariant=True)
_T = TypeVar("_T")
_T_co = TypeVar("_T_co", covariant=True)
_T_contra = TypeVar("_T_contra", contravariant=True)
class IdentityFunction(Protocol):
def __call__(self, __x: _T) -> _T: ...
class SupportsLessThan(Protocol):
def __lt__(self, __other: Any) -> bool: ...