Use PEP 585 syntax wherever possible (#6717)

This commit is contained in:
Alex Waygood
2021-12-28 10:31:43 +00:00
committed by GitHub
parent e6cb341d94
commit 8d5d2520ac
237 changed files with 966 additions and 1069 deletions

View File

@@ -9,7 +9,6 @@ from typing import (
SupportsComplex,
SupportsFloat,
SupportsInt,
Tuple,
Type,
TypeVar,
Union,
@@ -91,7 +90,7 @@ class filterfalse(Iterator[_T], Generic[_T]):
_T1 = TypeVar("_T1")
_T2 = TypeVar("_T2")
class groupby(Iterator[Tuple[_T, Iterator[_S]]], Generic[_T, _S]):
class groupby(Iterator[tuple[_T, Iterator[_S]]], Generic[_T, _S]):
@overload
def __new__(cls, iterable: Iterable[_T1], key: None = ...) -> groupby[_T1, _T1]: ...
@overload
@@ -117,7 +116,7 @@ class takewhile(Iterator[_T], Generic[_T]):
def __iter__(self) -> Iterator[_T]: ...
def __next__(self) -> _T: ...
def tee(__iterable: Iterable[_T], __n: int = ...) -> Tuple[Iterator[_T], ...]: ...
def tee(__iterable: Iterable[_T], __n: int = ...) -> tuple[Iterator[_T], ...]: ...
class zip_longest(Iterator[Any]):
def __init__(self, *p: Iterable[Any], fillvalue: Any = ...) -> None: ...
@@ -170,18 +169,18 @@ class product(Iterator[_T_co], Generic[_T_co]):
__iter6: Iterable[Any],
__iter7: Iterable[Any],
*iterables: Iterable[Any],
) -> product[Tuple[Any, ...]]: ...
) -> product[tuple[Any, ...]]: ...
@overload
def __new__(cls, *iterables: Iterable[_T1], repeat: int) -> product[Tuple[_T1, ...]]: ...
def __new__(cls, *iterables: Iterable[_T1], repeat: int) -> product[tuple[_T1, ...]]: ...
@overload
def __new__(cls, *iterables: Iterable[Any], repeat: int = ...) -> product[Tuple[Any, ...]]: ...
def __new__(cls, *iterables: Iterable[Any], repeat: int = ...) -> product[tuple[Any, ...]]: ...
def __iter__(self) -> Iterator[_T_co]: ...
def __next__(self) -> _T_co: ...
class permutations(Iterator[Tuple[_T, ...]], Generic[_T]):
class permutations(Iterator[tuple[_T, ...]], Generic[_T]):
def __init__(self, iterable: Iterable[_T], r: int | None = ...) -> None: ...
def __iter__(self) -> Iterator[Tuple[_T, ...]]: ...
def __next__(self) -> Tuple[_T, ...]: ...
def __iter__(self) -> Iterator[tuple[_T, ...]]: ...
def __next__(self) -> tuple[_T, ...]: ...
class combinations(Iterator[_T_co], Generic[_T_co]):
@overload
@@ -193,14 +192,14 @@ class combinations(Iterator[_T_co], Generic[_T_co]):
@overload
def __new__(cls, iterable: Iterable[_T], r: Literal[5]) -> combinations[tuple[_T, _T, _T, _T, _T]]: ...
@overload
def __new__(cls, iterable: Iterable[_T], r: int) -> combinations[Tuple[_T, ...]]: ...
def __new__(cls, iterable: Iterable[_T], r: int) -> combinations[tuple[_T, ...]]: ...
def __iter__(self) -> Iterator[_T_co]: ...
def __next__(self) -> _T_co: ...
class combinations_with_replacement(Iterator[Tuple[_T, ...]], Generic[_T]):
class combinations_with_replacement(Iterator[tuple[_T, ...]], Generic[_T]):
def __init__(self, iterable: Iterable[_T], r: int) -> None: ...
def __iter__(self) -> Iterator[Tuple[_T, ...]]: ...
def __next__(self) -> Tuple[_T, ...]: ...
def __iter__(self) -> Iterator[tuple[_T, ...]]: ...
def __next__(self) -> tuple[_T, ...]: ...
if sys.version_info >= (3, 10):
class pairwise(Iterator[_T_co], Generic[_T_co]):