mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Remove redundant inheritances from Iterator in builtins (#12851)
This commit is contained in:
@@ -952,6 +952,7 @@ class slice:
|
||||
def __hash__(self) -> int: ...
|
||||
else:
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
|
||||
def indices(self, len: SupportsIndex, /) -> tuple[int, int, int]: ...
|
||||
|
||||
class tuple(Sequence[_T_co]):
|
||||
@@ -1215,7 +1216,7 @@ class frozenset(AbstractSet[_T_co]):
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
|
||||
|
||||
class enumerate(Iterator[tuple[int, _T]]):
|
||||
class enumerate(Generic[_T]):
|
||||
def __new__(cls, iterable: Iterable[_T], start: int = 0) -> Self: ...
|
||||
def __iter__(self) -> Self: ...
|
||||
def __next__(self) -> tuple[int, _T]: ...
|
||||
@@ -1409,7 +1410,7 @@ else:
|
||||
|
||||
def exit(code: sys._ExitCode = None) -> NoReturn: ...
|
||||
|
||||
class filter(Iterator[_T]):
|
||||
class filter(Generic[_T]):
|
||||
@overload
|
||||
def __new__(cls, function: None, iterable: Iterable[_T | None], /) -> Self: ...
|
||||
@overload
|
||||
@@ -1470,7 +1471,7 @@ def len(obj: Sized, /) -> int: ...
|
||||
def license() -> None: ...
|
||||
def locals() -> dict[str, Any]: ...
|
||||
|
||||
class map(Iterator[_S]):
|
||||
class map(Generic[_S]):
|
||||
@overload
|
||||
def __new__(cls, func: Callable[[_T1], _S], iter1: Iterable[_T1], /) -> Self: ...
|
||||
@overload
|
||||
@@ -1712,7 +1713,7 @@ def pow(base: _SupportsSomeKindOfPow, exp: float, mod: None = None) -> Any: ...
|
||||
def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = None) -> complex: ...
|
||||
def quit(code: sys._ExitCode = None) -> NoReturn: ...
|
||||
|
||||
class reversed(Iterator[_T]):
|
||||
class reversed(Generic[_T]):
|
||||
@overload
|
||||
def __new__(cls, sequence: Reversible[_T], /) -> Iterator[_T]: ... # type: ignore[misc]
|
||||
@overload
|
||||
@@ -1773,7 +1774,7 @@ def vars(object: type, /) -> types.MappingProxyType[str, Any]: ...
|
||||
@overload
|
||||
def vars(object: Any = ..., /) -> dict[str, Any]: ...
|
||||
|
||||
class zip(Iterator[_T_co]):
|
||||
class zip(Generic[_T_co]):
|
||||
if sys.version_info >= (3, 10):
|
||||
@overload
|
||||
def __new__(cls, *, strict: bool = ...) -> zip[Any]: ...
|
||||
|
||||
Reference in New Issue
Block a user