diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index af1d1650da41..daa236f84cb5 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -665,7 +665,7 @@ class Sequence(Reversible[_T_co], Collection[_T_co]): # Mixin methods def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... def count(self, value: Any, /) -> int: ... - def __contains__(self, value: object, /) -> bool: ... + def __contains__(self, value: object, /) -> TypeGuard[_T_co]: ... def __iter__(self) -> Iterator[_T_co]: ... def __reversed__(self) -> Iterator[_T_co]: ... @@ -791,7 +791,7 @@ class Mapping(Collection[_KT], Generic[_KT, _VT_co]): def items(self) -> ItemsView[_KT, _VT_co]: ... def keys(self) -> KeysView[_KT]: ... def values(self) -> ValuesView[_VT_co]: ... - def __contains__(self, key: object, /) -> bool: ... + def __contains__(self, key: object, /) -> TypeGuard[_KT]: ... def __eq__(self, other: object, /) -> bool: ... class MutableMapping(Mapping[_KT, _VT]):