diff --git a/stdlib/@python2/_typeshed/__init__.pyi b/stdlib/@python2/_typeshed/__init__.pyi index 9548a2497..ca698e29a 100644 --- a/stdlib/@python2/_typeshed/__init__.pyi +++ b/stdlib/@python2/_typeshed/__init__.pyi @@ -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: ... diff --git a/stdlib/_typeshed/__init__.pyi b/stdlib/_typeshed/__init__.pyi index 26cbddcb8..69d1c7c16 100644 --- a/stdlib/_typeshed/__init__.pyi +++ b/stdlib/_typeshed/__init__.pyi @@ -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: ...