-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Remove redundant inheritances from Iterator in builtins"
- Loading branch information
Showing
3 changed files
with
76 additions
and
5 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
misc/typeshed_patches/0001-Revert-Remove-redundant-inheritances-from-Iterator.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
From 25250cbe1f7ee0e924ac03b3f19297e1885dd13e Mon Sep 17 00:00:00 2001 | ||
From: Marc Mueller <[email protected]> | ||
Date: Sat, 21 Dec 2024 22:36:38 +0100 | ||
Subject: [PATCH] Revert Remove redundant inheritances from Iterator in | ||
builtins | ||
|
||
--- | ||
mypy/typeshed/stdlib/builtins.pyi | 10 +++++----- | ||
1 file changed, 5 insertions(+), 5 deletions(-) | ||
|
||
diff --git a/mypy/typeshed/stdlib/builtins.pyi b/mypy/typeshed/stdlib/builtins.pyi | ||
index 5c6d321f7..56a5969d1 100644 | ||
--- a/mypy/typeshed/stdlib/builtins.pyi | ||
+++ b/mypy/typeshed/stdlib/builtins.pyi | ||
@@ -1130,7 +1130,7 @@ class frozenset(AbstractSet[_T_co]): | ||
if sys.version_info >= (3, 9): | ||
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... | ||
|
||
-class enumerate(Generic[_T]): | ||
+class enumerate(Iterator[tuple[int, _T]]): | ||
def __new__(cls, iterable: Iterable[_T], start: int = 0) -> Self: ... | ||
def __iter__(self) -> Self: ... | ||
def __next__(self) -> tuple[int, _T]: ... | ||
@@ -1324,7 +1324,7 @@ else: | ||
|
||
exit: _sitebuiltins.Quitter | ||
|
||
-class filter(Generic[_T]): | ||
+class filter(Iterator[_T]): | ||
@overload | ||
def __new__(cls, function: None, iterable: Iterable[_T | None], /) -> Self: ... | ||
@overload | ||
@@ -1389,7 +1389,7 @@ license: _sitebuiltins._Printer | ||
|
||
def locals() -> dict[str, Any]: ... | ||
|
||
-class map(Generic[_S]): | ||
+class map(Iterator[_S]): | ||
@overload | ||
def __new__(cls, func: Callable[[_T1], _S], iter1: Iterable[_T1], /) -> Self: ... | ||
@overload | ||
@@ -1632,7 +1632,7 @@ def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = None) -> complex | ||
|
||
quit: _sitebuiltins.Quitter | ||
|
||
-class reversed(Generic[_T]): | ||
+class reversed(Iterator[_T]): | ||
@overload | ||
def __new__(cls, sequence: Reversible[_T], /) -> Iterator[_T]: ... # type: ignore[misc] | ||
@overload | ||
@@ -1693,7 +1693,7 @@ def vars(object: type, /) -> types.MappingProxyType[str, Any]: ... | ||
@overload | ||
def vars(object: Any = ..., /) -> dict[str, Any]: ... | ||
|
||
-class zip(Generic[_T_co]): | ||
+class zip(Iterator[_T_co]): | ||
if sys.version_info >= (3, 10): | ||
@overload | ||
def __new__(cls, *, strict: bool = ...) -> zip[Any]: ... | ||
-- | ||
2.47.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters