mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
@@ -26,6 +26,10 @@ _T = TypeVar("_T")
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
_T_contra = TypeVar("_T_contra", contravariant=True)
|
||||
|
||||
# Use for "self" annotations:
|
||||
# def __enter__(self: Self) -> Self: ...
|
||||
Self = TypeVar("Self") # noqa Y001
|
||||
|
||||
class IdentityFunction(Protocol):
|
||||
def __call__(self, __x: _T) -> _T: ...
|
||||
|
||||
|
||||
@@ -18,6 +18,10 @@ _T = TypeVar("_T")
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
_T_contra = TypeVar("_T_contra", contravariant=True)
|
||||
|
||||
# Use for "self" annotations:
|
||||
# def __enter__(self: Self) -> Self: ...
|
||||
Self = TypeVar("Self") # noqa Y001
|
||||
|
||||
# stable
|
||||
class IdentityFunction(Protocol):
|
||||
def __call__(self, __x: _T) -> _T: ...
|
||||
|
||||
Reference in New Issue
Block a user