@@ -11,8 +11,11 @@ from _typeshed import (
11
11
ReadableBuffer ,
12
12
Self ,
13
13
StrOrBytesPath ,
14
+ SupportsAdd ,
15
+ SupportsAiter ,
14
16
SupportsAnext ,
15
17
SupportsDivMod ,
18
+ SupportsIter ,
16
19
SupportsKeysAndGetItem ,
17
20
SupportsLenAndGetItem ,
18
21
SupportsNext ,
@@ -71,12 +74,6 @@ _SupportsAnextT = TypeVar("_SupportsAnextT", bound=SupportsAnext[Any], covariant
71
74
_AwaitableT = TypeVar ("_AwaitableT" , bound = Awaitable [Any ])
72
75
_AwaitableT_co = TypeVar ("_AwaitableT_co" , bound = Awaitable [Any ], covariant = True )
73
76
74
- class _SupportsIter (Protocol [_T_co ]):
75
- def __iter__ (self ) -> _T_co : ...
76
-
77
- class _SupportsAiter (Protocol [_T_co ]):
78
- def __aiter__ (self ) -> _T_co : ...
79
-
80
77
class object :
81
78
__doc__ : str | None
82
79
__dict__ : dict [str , Any ]
@@ -1094,7 +1091,7 @@ class _PathLike(Protocol[_AnyStr_co]):
1094
1091
def __fspath__ (self ) -> _AnyStr_co : ...
1095
1092
1096
1093
if sys .version_info >= (3 , 10 ):
1097
- def aiter (__async_iterable : _SupportsAiter [_SupportsAnextT ]) -> _SupportsAnextT : ...
1094
+ def aiter (__async_iterable : SupportsAiter [_SupportsAnextT ]) -> _SupportsAnextT : ...
1098
1095
1099
1096
class _SupportsSynchronousAnext (Protocol [_AwaitableT_co ]):
1100
1097
def __anext__ (self ) -> _AwaitableT_co : ...
@@ -1186,7 +1183,7 @@ def hex(__number: int | SupportsIndex) -> str: ...
1186
1183
def id (__obj : object ) -> int : ...
1187
1184
def input (__prompt : object = ...) -> str : ...
1188
1185
@overload
1189
- def iter (__iterable : _SupportsIter [_SupportsNextT ]) -> _SupportsNextT : ...
1186
+ def iter (__iterable : SupportsIter [_SupportsNextT ]) -> _SupportsNextT : ...
1190
1187
@overload
1191
1188
def iter (__function : Callable [[], _T | None ], __sentinel : None ) -> Iterator [_T ]: ...
1192
1189
@overload
@@ -1503,11 +1500,8 @@ def sorted(
1503
1500
@overload
1504
1501
def sorted (__iterable : Iterable [_T ], * , key : Callable [[_T ], SupportsRichComparison ], reverse : bool = ...) -> list [_T ]: ...
1505
1502
1506
- class _SupportsSum (Protocol ):
1507
- def __add__ (self , __x : Any ) -> Any : ...
1508
-
1509
- _SumT = TypeVar ("_SumT" , bound = _SupportsSum )
1510
- _SumS = TypeVar ("_SumS" , bound = _SupportsSum )
1503
+ _SumT = TypeVar ("_SumT" , bound = SupportsAdd )
1504
+ _SumS = TypeVar ("_SumS" , bound = SupportsAdd )
1511
1505
1512
1506
@overload
1513
1507
def sum (__iterable : Iterable [_SumT ]) -> _SumT | Literal [0 ]: ...
0 commit comments