@@ -630,7 +630,7 @@ class str(Sequence[str]):
630630 def __add__ (self , value : str , / ) -> str : ... # type: ignore[misc]
631631 # Incompatible with Sequence.__contains__
632632 def __contains__ (self , key : str , / ) -> bool : ... # type: ignore[override]
633- def __eq__ (self , value : object , / ) -> bool : ...
633+ def __eq__ (self , value : object , / ) -> TypeGuard [ str ] : ...
634634 def __ge__ (self , value : str , / ) -> bool : ...
635635 @overload
636636 def __getitem__ (self : LiteralString , key : SupportsIndex | slice [SupportsIndex | None ], / ) -> LiteralString : ...
@@ -753,7 +753,7 @@ class bytes(Sequence[int]):
753753 def __mod__ (self , value : Any , / ) -> bytes : ...
754754 # Incompatible with Sequence.__contains__
755755 def __contains__ (self , key : SupportsIndex | ReadableBuffer , / ) -> bool : ... # type: ignore[override]
756- def __eq__ (self , value : object , / ) -> bool : ...
756+ def __eq__ (self , value : object , / ) -> TypeGuard [ bytes ] : ...
757757 def __ne__ (self , value : object , / ) -> bool : ...
758758 def __lt__ (self , value : bytes , / ) -> bool : ...
759759 def __le__ (self , value : bytes , / ) -> bool : ...
@@ -1053,7 +1053,7 @@ class tuple(Sequence[_T_co]):
10531053 def __le__ (self , value : tuple [_T_co , ...], / ) -> bool : ...
10541054 def __gt__ (self , value : tuple [_T_co , ...], / ) -> bool : ...
10551055 def __ge__ (self , value : tuple [_T_co , ...], / ) -> bool : ...
1056- def __eq__ (self , value : object , / ) -> bool : ...
1056+ def __eq__ (self , value : object , / ) -> TypeGuard [ tuple ] : ...
10571057 def __hash__ (self ) -> int : ...
10581058 @overload
10591059 def __add__ (self , value : tuple [_T_co , ...], / ) -> tuple [_T_co , ...]: ...
@@ -1168,7 +1168,7 @@ class list(MutableSequence[_T]):
11681168 def __ge__ (self , value : list [_T ], / ) -> bool : ...
11691169 def __lt__ (self , value : list [_T ], / ) -> bool : ...
11701170 def __le__ (self , value : list [_T ], / ) -> bool : ...
1171- def __eq__ (self , value : object , / ) -> bool : ...
1171+ def __eq__ (self , value : object , / ) -> TypeGuard [ list ] : ...
11721172 def __class_getitem__ (cls , item : Any , / ) -> GenericAlias : ...
11731173
11741174@disjoint_base
@@ -1236,7 +1236,7 @@ class dict(MutableMapping[_KT, _VT]):
12361236 def __setitem__ (self , key : _KT , value : _VT , / ) -> None : ...
12371237 def __delitem__ (self , key : _KT , / ) -> None : ...
12381238 def __iter__ (self ) -> Iterator [_KT ]: ...
1239- def __eq__ (self , value : object , / ) -> bool : ...
1239+ def __eq__ (self , value : object , / ) -> TypeGuard [ dict ] : ...
12401240 def __reversed__ (self ) -> Iterator [_KT ]: ...
12411241 __hash__ : ClassVar [None ] # type: ignore[assignment]
12421242 def __class_getitem__ (cls , item : Any , / ) -> GenericAlias : ...
@@ -1290,7 +1290,7 @@ class set(MutableSet[_T]):
12901290 def __lt__ (self , value : AbstractSet [object ], / ) -> bool : ...
12911291 def __ge__ (self , value : AbstractSet [object ], / ) -> bool : ...
12921292 def __gt__ (self , value : AbstractSet [object ], / ) -> bool : ...
1293- def __eq__ (self , value : object , / ) -> bool : ...
1293+ def __eq__ (self , value : object , / ) -> TypeGuard [ set ] : ...
12941294 __hash__ : ClassVar [None ] # type: ignore[assignment]
12951295 def __class_getitem__ (cls , item : Any , / ) -> GenericAlias : ...
12961296
@@ -1319,7 +1319,7 @@ class frozenset(AbstractSet[_T_co]):
13191319 def __lt__ (self , value : AbstractSet [object ], / ) -> bool : ...
13201320 def __ge__ (self , value : AbstractSet [object ], / ) -> bool : ...
13211321 def __gt__ (self , value : AbstractSet [object ], / ) -> bool : ...
1322- def __eq__ (self , value : object , / ) -> bool : ...
1322+ def __eq__ (self , value : object , / ) -> TypeGuard [ frozenset ] : ...
13231323 def __hash__ (self ) -> int : ...
13241324 def __class_getitem__ (cls , item : Any , / ) -> GenericAlias : ...
13251325
@@ -1549,6 +1549,7 @@ help: _sitebuiltins._Helper
15491549def hex (number : SupportsIndex , / ) -> str : ...
15501550def id (obj : object , / ) -> int : ...
15511551def input (prompt : object = "" , / ) -> str : ...
1552+
15521553@type_check_only
15531554class _GetItemIterable (Protocol [_T_co ]):
15541555 def __getitem__ (self , i : int , / ) -> _T_co : ...
@@ -1574,6 +1575,7 @@ def len(obj: Sized, /) -> int: ...
15741575license : _sitebuiltins ._Printer
15751576
15761577def locals () -> dict [str , Any ]: ...
1578+
15771579@disjoint_base
15781580class map (Generic [_S ]):
15791581 # 3.14 adds `strict` argument.
@@ -1804,6 +1806,7 @@ def open(
18041806 opener : _Opener | None = None ,
18051807) -> IO [Any ]: ...
18061808def ord (c : str | bytes | bytearray , / ) -> int : ...
1809+
18071810@type_check_only
18081811class _SupportsWriteAndFlush (SupportsWrite [_T_contra ], SupportsFlush , Protocol [_T_contra ]): ...
18091812
@@ -1945,6 +1948,7 @@ def sum(iterable: Iterable[_AddableT1], /, start: _AddableT2) -> _AddableT1 | _A
19451948def vars (object : type , / ) -> types .MappingProxyType [str , Any ]: ...
19461949@overload
19471950def vars (object : Any = ..., / ) -> dict [str , Any ]: ...
1951+
19481952@disjoint_base
19491953class zip (Generic [_T_co ]):
19501954 if sys .version_info >= (3 , 10 ):
0 commit comments