Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Jan 6, 2024
1 parent 669d436 commit fa169be
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 52 deletions.
43 changes: 19 additions & 24 deletions stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1402,8 +1402,8 @@ class map(Iterator[_S]):
def __new__(cls, func: Callable[[_T1, _T2], _S], iter1: Iterable[_T1], iter2: Iterable[_T2], /) -> Self: ...
@overload
def __new__(
cls, func: Callable[[_T1, _T2, _T3], _S], iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
/) -> Self: ...
cls, func: Callable[[_T1, _T2, _T3], _S], iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], /
) -> Self: ...
@overload
def __new__(
cls,
Expand All @@ -1412,7 +1412,8 @@ class map(Iterator[_S]):
iter2: Iterable[_T2],
iter3: Iterable[_T3],
iter4: Iterable[_T4],
/) -> Self: ...
/,
) -> Self: ...
@overload
def __new__(
cls,
Expand All @@ -1422,7 +1423,8 @@ class map(Iterator[_S]):
iter3: Iterable[_T3],
iter4: Iterable[_T4],
iter5: Iterable[_T5],
/) -> Self: ...
/,
) -> Self: ...
@overload
def __new__(
cls,
Expand All @@ -1433,7 +1435,8 @@ class map(Iterator[_S]):
iter4: Iterable[Any],
iter5: Iterable[Any],
iter6: Iterable[Any],
/, *iterables: Iterable[Any],
/,
*iterables: Iterable[Any],
) -> Self: ...
def __iter__(self) -> Self: ...
def __next__(self) -> _S: ...
Expand Down Expand Up @@ -1710,13 +1713,7 @@ class zip(Iterator[_T_co]):
) -> zip[tuple[_T1, _T2, _T3]]: ...
@overload
def __new__(
cls,
iter1: Iterable[_T1],
iter2: Iterable[_T2],
iter3: Iterable[_T3],
iter4: Iterable[_T4],
/, *,
strict: bool = ...,
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], /, *, strict: bool = ...
) -> zip[tuple[_T1, _T2, _T3, _T4]]: ...
@overload
def __new__(
Expand All @@ -1726,7 +1723,8 @@ class zip(Iterator[_T_co]):
iter3: Iterable[_T3],
iter4: Iterable[_T4],
iter5: Iterable[_T5],
/, *,
/,
*,
strict: bool = ...,
) -> zip[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
@overload
Expand All @@ -1738,7 +1736,8 @@ class zip(Iterator[_T_co]):
iter4: Iterable[Any],
iter5: Iterable[Any],
iter6: Iterable[Any],
/, *iterables: Iterable[Any],
/,
*iterables: Iterable[Any],
strict: bool = ...,
) -> zip[tuple[Any, ...]]: ...
else:
Expand All @@ -1752,17 +1751,12 @@ class zip(Iterator[_T_co]):
def __new__(cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], /) -> zip[tuple[_T1, _T2, _T3]]: ...
@overload
def __new__(
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4],
/) -> zip[tuple[_T1, _T2, _T3, _T4]]: ...
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], /
) -> zip[tuple[_T1, _T2, _T3, _T4]]: ...
@overload
def __new__(
cls,
iter1: Iterable[_T1],
iter2: Iterable[_T2],
iter3: Iterable[_T3],
iter4: Iterable[_T4],
iter5: Iterable[_T5],
/) -> zip[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5], /
) -> zip[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
@overload
def __new__(
cls,
Expand All @@ -1772,7 +1766,8 @@ class zip(Iterator[_T_co]):
iter4: Iterable[Any],
iter5: Iterable[Any],
iter6: Iterable[Any],
/, *iterables: Iterable[Any],
/,
*iterables: Iterable[Any],
) -> zip[tuple[Any, ...]]: ...

def __iter__(self) -> Self: ...
Expand Down
45 changes: 20 additions & 25 deletions stdlib/itertools.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -126,31 +126,26 @@ class zip_longest(Iterator[_T_co]):
# three iterables
@overload
def __new__(
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
/) -> zip_longest[tuple[_T1 | Any, _T2 | Any, _T3 | Any]]: ...
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], /
) -> zip_longest[tuple[_T1 | Any, _T2 | Any, _T3 | Any]]: ...
@overload
def __new__(
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], /, *, fillvalue: _T
) -> zip_longest[tuple[_T1 | _T, _T2 | _T, _T3 | _T]]: ...
# four iterables
@overload
def __new__(
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4],
/) -> zip_longest[tuple[_T1 | Any, _T2 | Any, _T3 | Any, _T4 | Any]]: ...
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], /
) -> zip_longest[tuple[_T1 | Any, _T2 | Any, _T3 | Any, _T4 | Any]]: ...
@overload
def __new__(
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], /, *, fillvalue: _T
) -> zip_longest[tuple[_T1 | _T, _T2 | _T, _T3 | _T, _T4 | _T]]: ...
# five iterables
@overload
def __new__(
cls,
iter1: Iterable[_T1],
iter2: Iterable[_T2],
iter3: Iterable[_T3],
iter4: Iterable[_T4],
iter5: Iterable[_T5],
/) -> zip_longest[tuple[_T1 | Any, _T2 | Any, _T3 | Any, _T4 | Any, _T5 | Any]]: ...
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5], /
) -> zip_longest[tuple[_T1 | Any, _T2 | Any, _T3 | Any, _T4 | Any, _T5 | Any]]: ...
@overload
def __new__(
cls,
Expand All @@ -159,7 +154,8 @@ class zip_longest(Iterator[_T_co]):
iter3: Iterable[_T3],
iter4: Iterable[_T4],
iter5: Iterable[_T5],
/, *,
/,
*,
fillvalue: _T,
) -> zip_longest[tuple[_T1 | _T, _T2 | _T, _T3 | _T, _T4 | _T, _T5 | _T]]: ...
# six or more iterables
Expand All @@ -172,7 +168,8 @@ class zip_longest(Iterator[_T_co]):
iter4: Iterable[_T],
iter5: Iterable[_T],
iter6: Iterable[_T],
/, *iterables: Iterable[_T],
/,
*iterables: Iterable[_T],
) -> zip_longest[tuple[_T | Any, ...]]: ...
@overload
def __new__(
Expand All @@ -183,7 +180,8 @@ class zip_longest(Iterator[_T_co]):
iter4: Iterable[_T],
iter5: Iterable[_T],
iter6: Iterable[_T],
/, *iterables: Iterable[_T],
/,
*iterables: Iterable[_T],
fillvalue: _T,
) -> zip_longest[tuple[_T, ...]]: ...
def __iter__(self) -> Self: ...
Expand All @@ -198,17 +196,12 @@ class product(Iterator[_T_co]):
def __new__(cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], /) -> product[tuple[_T1, _T2, _T3]]: ...
@overload
def __new__(
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4],
/) -> product[tuple[_T1, _T2, _T3, _T4]]: ...
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], /
) -> product[tuple[_T1, _T2, _T3, _T4]]: ...
@overload
def __new__(
cls,
iter1: Iterable[_T1],
iter2: Iterable[_T2],
iter3: Iterable[_T3],
iter4: Iterable[_T4],
iter5: Iterable[_T5],
/) -> product[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5], /
) -> product[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
@overload
def __new__(
cls,
Expand All @@ -218,7 +211,8 @@ class product(Iterator[_T_co]):
iter4: Iterable[_T4],
iter5: Iterable[_T5],
iter6: Iterable[_T6],
/) -> product[tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ...
/,
) -> product[tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ...
@overload
def __new__(
cls,
Expand All @@ -229,7 +223,8 @@ class product(Iterator[_T_co]):
iter5: Iterable[Any],
iter6: Iterable[Any],
iter7: Iterable[Any],
/, *iterables: Iterable[Any],
/,
*iterables: Iterable[Any],
) -> product[tuple[Any, ...]]: ...
@overload
def __new__(cls, *iterables: Iterable[_T1], repeat: int) -> product[tuple[_T1, ...]]: ...
Expand Down
9 changes: 6 additions & 3 deletions stdlib/types.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ class CodeType:
exceptiontable: bytes,
freevars: tuple[str, ...] = ...,
cellvars: tuple[str, ...] = ...,
/) -> Self: ...
/,
) -> Self: ...
elif sys.version_info >= (3, 10):
def __new__(
cls,
Expand All @@ -196,7 +197,8 @@ class CodeType:
linetable: bytes,
freevars: tuple[str, ...] = ...,
cellvars: tuple[str, ...] = ...,
/) -> Self: ...
/,
) -> Self: ...
else:
def __new__(
cls,
Expand All @@ -216,7 +218,8 @@ class CodeType:
lnotab: bytes,
freevars: tuple[str, ...] = ...,
cellvars: tuple[str, ...] = ...,
/) -> Self: ...
/,
) -> Self: ...
if sys.version_info >= (3, 11):
def replace(
self,
Expand Down

0 comments on commit fa169be

Please sign in to comment.