mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-21 03:11:16 +08:00
Provide precise type hints for combinations_with_replacement (#11068)
This commit is contained in:
@@ -270,10 +270,19 @@ class combinations(Iterator[_T_co]):
|
||||
def __iter__(self) -> Self: ...
|
||||
def __next__(self) -> _T_co: ...
|
||||
|
||||
class combinations_with_replacement(Iterator[tuple[_T, ...]], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T], r: int) -> None: ...
|
||||
class combinations_with_replacement(Iterator[_T_co]):
|
||||
@overload
|
||||
def __new__(cls, iterable: Iterable[_T], r: Literal[2]) -> combinations_with_replacement[tuple[_T, _T]]: ...
|
||||
@overload
|
||||
def __new__(cls, iterable: Iterable[_T], r: Literal[3]) -> combinations_with_replacement[tuple[_T, _T, _T]]: ...
|
||||
@overload
|
||||
def __new__(cls, iterable: Iterable[_T], r: Literal[4]) -> combinations_with_replacement[tuple[_T, _T, _T, _T]]: ...
|
||||
@overload
|
||||
def __new__(cls, iterable: Iterable[_T], r: Literal[5]) -> combinations_with_replacement[tuple[_T, _T, _T, _T, _T]]: ...
|
||||
@overload
|
||||
def __new__(cls, iterable: Iterable[_T], r: int) -> combinations_with_replacement[tuple[_T, ...]]: ...
|
||||
def __iter__(self) -> Self: ...
|
||||
def __next__(self) -> tuple[_T, ...]: ...
|
||||
def __next__(self) -> _T_co: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
class pairwise(Iterator[_T_co]):
|
||||
|
||||
Reference in New Issue
Block a user