@@ -629,7 +629,7 @@ class str(Sequence[str]):
629629 @overload
630630 def __add__ (self , value : str , / ) -> str : ... # type: ignore[misc]
631631 # Incompatible with Sequence.__contains__
632- def __contains__ (self , key : str , / ) -> bool : ... # type: ignore[override]
632+ def __contains__ (self , key : str , / ) -> TypeGuard [ str ] : ... # type: ignore[override]
633633 def __eq__ (self , value : object , / ) -> bool : ...
634634 def __ge__ (self , value : str , / ) -> bool : ...
635635 @overload
@@ -1162,7 +1162,7 @@ class list(MutableSequence[_T]):
11621162 def __mul__ (self , value : SupportsIndex , / ) -> list [_T ]: ...
11631163 def __rmul__ (self , value : SupportsIndex , / ) -> list [_T ]: ...
11641164 def __imul__ (self , value : SupportsIndex , / ) -> Self : ...
1165- def __contains__ (self , key : object , / ) -> bool : ...
1165+ def __contains__ (self , key : object , / ) -> TypeGuard [ _T ] : ...
11661166 def __reversed__ (self ) -> Iterator [_T ]: ...
11671167 def __gt__ (self , value : list [_T ], / ) -> bool : ...
11681168 def __ge__ (self , value : list [_T ], / ) -> bool : ...
@@ -1276,7 +1276,7 @@ class set(MutableSet[_T]):
12761276 def union (self , * s : Iterable [_S ]) -> set [_T | _S ]: ...
12771277 def update (self , * s : Iterable [_T ]) -> None : ...
12781278 def __len__ (self ) -> int : ...
1279- def __contains__ (self , o : object , / ) -> bool : ...
1279+ def __contains__ (self , o : object , / ) -> TypeGuard [ _T ] : ...
12801280 def __iter__ (self ) -> Iterator [_T ]: ...
12811281 def __and__ (self , value : AbstractSet [object ], / ) -> set [_T ]: ...
12821282 def __iand__ (self , value : AbstractSet [object ], / ) -> Self : ...
@@ -1309,7 +1309,7 @@ class frozenset(AbstractSet[_T_co]):
13091309 def symmetric_difference (self , s : Iterable [_T_co ], / ) -> frozenset [_T_co ]: ...
13101310 def union (self , * s : Iterable [_S ]) -> frozenset [_T_co | _S ]: ...
13111311 def __len__ (self ) -> int : ...
1312- def __contains__ (self , o : object , / ) -> bool : ...
1312+ def __contains__ (self , o : object , / ) -> TypeGuard [ _T_co ] : ...
13131313 def __iter__ (self ) -> Iterator [_T_co ]: ...
13141314 def __and__ (self , value : AbstractSet [_T_co ], / ) -> frozenset [_T_co ]: ...
13151315 def __or__ (self , value : AbstractSet [_S ], / ) -> frozenset [_T_co | _S ]: ...
0 commit comments