Skip to content

Commit 1fb6ebf

Browse files
authored
Remove redundant inheritances from Iterator (#12814)
1 parent f08d769 commit 1fb6ebf

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

stdlib/csv.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if sys.version_info >= (3, 12):
2424
from _csv import QUOTE_NOTNULL as QUOTE_NOTNULL, QUOTE_STRINGS as QUOTE_STRINGS
2525

2626
from _typeshed import SupportsWrite
27-
from collections.abc import Collection, Iterable, Iterator, Mapping, Sequence
27+
from collections.abc import Collection, Iterable, Mapping, Sequence
2828
from typing import Any, Generic, Literal, TypeVar, overload
2929
from typing_extensions import Self
3030

@@ -66,7 +66,7 @@ class excel(Dialect): ...
6666
class excel_tab(excel): ...
6767
class unix_dialect(Dialect): ...
6868

69-
class DictReader(Iterator[dict[_T | Any, str | Any]], Generic[_T]):
69+
class DictReader(Generic[_T]):
7070
fieldnames: Sequence[_T] | None
7171
restkey: _T | None
7272
restval: str | Any | None

stdlib/fileinput.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import sys
22
from _typeshed import AnyStr_co, StrOrBytesPath
3-
from collections.abc import Callable, Iterable, Iterator
3+
from collections.abc import Callable, Iterable
44
from types import TracebackType
5-
from typing import IO, Any, AnyStr, Literal, Protocol, overload
5+
from typing import IO, Any, AnyStr, Generic, Literal, Protocol, overload
66
from typing_extensions import Self, TypeAlias
77

88
if sys.version_info >= (3, 9):
@@ -107,7 +107,7 @@ def fileno() -> int: ...
107107
def isfirstline() -> bool: ...
108108
def isstdin() -> bool: ...
109109

110-
class FileInput(Iterator[AnyStr]):
110+
class FileInput(Generic[AnyStr]):
111111
if sys.version_info >= (3, 10):
112112
# encoding and errors are added
113113
@overload

stdlib/multiprocessing/pool.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from collections.abc import Callable, Iterable, Iterator, Mapping
2+
from collections.abc import Callable, Iterable, Mapping
33
from types import TracebackType
44
from typing import Any, Final, Generic, TypeVar
55
from typing_extensions import Self
@@ -36,7 +36,7 @@ class MapResult(ApplyResult[list[_T]]):
3636
error_callback: Callable[[BaseException], object] | None,
3737
) -> None: ...
3838

39-
class IMapIterator(Iterator[_T]):
39+
class IMapIterator(Generic[_T]):
4040
def __init__(self, pool: Pool) -> None: ...
4141
def __iter__(self) -> Self: ...
4242
def next(self, timeout: float | None = None) -> _T: ...

0 commit comments

Comments
 (0)