mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -6,7 +6,6 @@ from typing import (
|
||||
Generic,
|
||||
Iterable,
|
||||
Iterator,
|
||||
Optional,
|
||||
SupportsComplex,
|
||||
SupportsFloat,
|
||||
SupportsInt,
|
||||
@@ -53,11 +52,11 @@ class repeat(Iterator[_T], Generic[_T]):
|
||||
class accumulate(Iterator[_T], Generic[_T]):
|
||||
if sys.version_info >= (3, 8):
|
||||
@overload
|
||||
def __init__(self, iterable: Iterable[_T], func: None = ..., *, initial: Optional[_T] = ...) -> None: ...
|
||||
def __init__(self, iterable: Iterable[_T], func: None = ..., *, initial: _T | None = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self, iterable: Iterable[_S], func: Callable[[_T, _S], _T], *, initial: Optional[_T] = ...) -> None: ...
|
||||
def __init__(self, iterable: Iterable[_S], func: Callable[[_T, _S], _T], *, initial: _T | None = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, iterable: Iterable[_T], func: Optional[Callable[[_T, _T], _T]] = ...) -> None: ...
|
||||
def __init__(self, iterable: Iterable[_T], func: Callable[[_T, _T], _T] | None = ...) -> None: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __next__(self) -> _T: ...
|
||||
|
||||
@@ -80,7 +79,7 @@ class dropwhile(Iterator[_T], Generic[_T]):
|
||||
def __next__(self) -> _T: ...
|
||||
|
||||
class filterfalse(Iterator[_T], Generic[_T]):
|
||||
def __init__(self, __predicate: Optional[Predicate[_T]], __iterable: Iterable[_T]) -> None: ...
|
||||
def __init__(self, __predicate: Predicate[_T] | None, __iterable: Iterable[_T]) -> None: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __next__(self) -> _T: ...
|
||||
|
||||
@@ -97,11 +96,9 @@ class groupby(Iterator[Tuple[_T, Iterator[_S]]], Generic[_T, _S]):
|
||||
|
||||
class islice(Iterator[_T], Generic[_T]):
|
||||
@overload
|
||||
def __init__(self, __iterable: Iterable[_T], __stop: Optional[int]) -> None: ...
|
||||
def __init__(self, __iterable: Iterable[_T], __stop: int | None) -> None: ...
|
||||
@overload
|
||||
def __init__(
|
||||
self, __iterable: Iterable[_T], __start: Optional[int], __stop: Optional[int], __step: Optional[int] = ...
|
||||
) -> None: ...
|
||||
def __init__(self, __iterable: Iterable[_T], __start: int | None, __stop: int | None, __step: int | None = ...) -> None: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __next__(self) -> _T: ...
|
||||
|
||||
@@ -177,7 +174,7 @@ class product(Iterator[_T_co], Generic[_T_co]):
|
||||
def __next__(self) -> _T_co: ...
|
||||
|
||||
class permutations(Iterator[Tuple[_T, ...]], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T], r: Optional[int] = ...) -> None: ...
|
||||
def __init__(self, iterable: Iterable[_T], r: int | None = ...) -> None: ...
|
||||
def __iter__(self) -> Iterator[Tuple[_T, ...]]: ...
|
||||
def __next__(self) -> Tuple[_T, ...]: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user