mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Backport many Self-related changes to the Python-2 stdlib (#7128)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Self
|
||||
from typing import Any, Callable, Generic, Iterable, Iterator, Sequence, TypeVar, overload
|
||||
|
||||
_T = TypeVar("_T")
|
||||
@@ -8,14 +9,14 @@ def count(start: int = ..., step: int = ...) -> Iterator[int]: ... # more gener
|
||||
class cycle(Iterator[_T], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T]) -> None: ...
|
||||
def next(self) -> _T: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __iter__(self: Self) -> Self: ...
|
||||
|
||||
def repeat(object: _T, times: int = ...) -> Iterator[_T]: ...
|
||||
|
||||
class chain(Iterator[_T], Generic[_T]):
|
||||
def __init__(self, *iterables: Iterable[_T]) -> None: ...
|
||||
def next(self) -> _T: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __iter__(self: Self) -> Self: ...
|
||||
@staticmethod
|
||||
def from_iterable(iterable: Iterable[Iterable[_S]]) -> Iterator[_S]: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user