diff --git a/python/helpers/typeshed/stdlib/_typeshed/__init__.pyi b/python/helpers/typeshed/stdlib/_typeshed/__init__.pyi index a3f56899247b..1eec268d5c31 100644 --- a/python/helpers/typeshed/stdlib/_typeshed/__init__.pyi +++ b/python/helpers/typeshed/stdlib/_typeshed/__init__.pyi @@ -23,6 +23,9 @@ _T_contra = TypeVar("_T_contra", contravariant=True) # def __enter__(self: Self) -> Self: ... Self = TypeVar("Self") # noqa Y001 +# covariant version of typing.AnyStr, useful for protocols +AnyStr_co = TypeVar("AnyStr_co", str, bytes, covariant=True) # noqa: Y001 + # stable class IdentityFunction(Protocol): def __call__(self, __x: _T) -> _T: ...