Skip to content

Remove redundant inheritances from Iterator #12814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stdlib/csv.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if sys.version_info >= (3, 12):
from _csv import QUOTE_NOTNULL as QUOTE_NOTNULL, QUOTE_STRINGS as QUOTE_STRINGS

from _typeshed import SupportsWrite
from collections.abc import Collection, Iterable, Iterator, Mapping, Sequence
from collections.abc import Collection, Iterable, Mapping, Sequence
from typing import Any, Generic, Literal, TypeVar, overload
from typing_extensions import Self

Expand Down Expand Up @@ -66,7 +66,7 @@ class excel(Dialect): ...
class excel_tab(excel): ...
class unix_dialect(Dialect): ...

class DictReader(Iterator[dict[_T | Any, str | Any]], Generic[_T]):
class DictReader(Generic[_T]):
fieldnames: Sequence[_T] | None
restkey: _T | None
restval: str | Any | None
Expand Down
6 changes: 3 additions & 3 deletions stdlib/fileinput.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys
from _typeshed import AnyStr_co, StrOrBytesPath
from collections.abc import Callable, Iterable, Iterator
from collections.abc import Callable, Iterable
from types import TracebackType
from typing import IO, Any, AnyStr, Literal, Protocol, overload
from typing import IO, Any, AnyStr, Generic, Literal, Protocol, overload
from typing_extensions import Self, TypeAlias

if sys.version_info >= (3, 9):
Expand Down Expand Up @@ -107,7 +107,7 @@ def fileno() -> int: ...
def isfirstline() -> bool: ...
def isstdin() -> bool: ...

class FileInput(Iterator[AnyStr]):
class FileInput(Generic[AnyStr]):
if sys.version_info >= (3, 10):
# encoding and errors are added
@overload
Expand Down
4 changes: 2 additions & 2 deletions stdlib/multiprocessing/pool.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from collections.abc import Callable, Iterable, Iterator, Mapping
from collections.abc import Callable, Iterable, Mapping
from types import TracebackType
from typing import Any, Final, Generic, TypeVar
from typing_extensions import Self
Expand Down Expand Up @@ -36,7 +36,7 @@ class MapResult(ApplyResult[list[_T]]):
error_callback: Callable[[BaseException], object] | None,
) -> None: ...

class IMapIterator(Iterator[_T]):
class IMapIterator(Generic[_T]):
def __init__(self, pool: Pool) -> None: ...
def __iter__(self) -> Self: ...
def next(self, timeout: float | None = None) -> _T: ...
Expand Down
Loading