Use lowercase tuple where possible (#6170)

This commit is contained in:
Akuli
2021-10-15 00:18:19 +00:00
committed by GitHub
parent 5f386b0575
commit 994b69ef8f
242 changed files with 1212 additions and 1224 deletions

View File

@@ -178,7 +178,7 @@ class int:
@overload
def __new__(cls: Type[_T], x: str | bytes | bytearray, base: SupportsIndex) -> _T: ...
if sys.version_info >= (3, 8):
def as_integer_ratio(self) -> Tuple[int, Literal[1]]: ...
def as_integer_ratio(self) -> tuple[int, Literal[1]]: ...
@property
def real(self) -> int: ...
@property
@@ -202,14 +202,14 @@ class int:
def __floordiv__(self, x: int) -> int: ...
def __truediv__(self, x: int) -> float: ...
def __mod__(self, x: int) -> int: ...
def __divmod__(self, x: int) -> Tuple[int, int]: ...
def __divmod__(self, x: int) -> tuple[int, int]: ...
def __radd__(self, x: int) -> int: ...
def __rsub__(self, x: int) -> int: ...
def __rmul__(self, x: int) -> int: ...
def __rfloordiv__(self, x: int) -> int: ...
def __rtruediv__(self, x: int) -> float: ...
def __rmod__(self, x: int) -> int: ...
def __rdivmod__(self, x: int) -> Tuple[int, int]: ...
def __rdivmod__(self, x: int) -> tuple[int, int]: ...
@overload
def __pow__(self, __x: Literal[2], __modulo: int | None = ...) -> int: ...
@overload
@@ -232,7 +232,7 @@ class int:
def __ceil__(self) -> int: ...
def __floor__(self) -> int: ...
def __round__(self, ndigits: SupportsIndex = ...) -> int: ...
def __getnewargs__(self) -> Tuple[int]: ...
def __getnewargs__(self) -> tuple[int]: ...
def __eq__(self, x: object) -> bool: ...
def __ne__(self, x: object) -> bool: ...
def __lt__(self, x: int) -> bool: ...
@@ -249,7 +249,7 @@ class int:
class float:
def __new__(cls: Type[_T], x: SupportsFloat | SupportsIndex | str | bytes | bytearray = ...) -> _T: ...
def as_integer_ratio(self) -> Tuple[int, int]: ...
def as_integer_ratio(self) -> tuple[int, int]: ...
def hex(self) -> str: ...
def is_integer(self) -> bool: ...
@classmethod
@@ -265,7 +265,7 @@ class float:
def __floordiv__(self, x: float) -> float: ...
def __truediv__(self, x: float) -> float: ...
def __mod__(self, x: float) -> float: ...
def __divmod__(self, x: float) -> Tuple[float, float]: ...
def __divmod__(self, x: float) -> tuple[float, float]: ...
def __pow__(
self, x: float, mod: None = ...
) -> float: ... # In Python 3, returns complex if self is negative and x is not whole
@@ -275,9 +275,9 @@ class float:
def __rfloordiv__(self, x: float) -> float: ...
def __rtruediv__(self, x: float) -> float: ...
def __rmod__(self, x: float) -> float: ...
def __rdivmod__(self, x: float) -> Tuple[float, float]: ...
def __rdivmod__(self, x: float) -> tuple[float, float]: ...
def __rpow__(self, x: float, mod: None = ...) -> float: ...
def __getnewargs__(self) -> Tuple[float]: ...
def __getnewargs__(self) -> tuple[float]: ...
def __trunc__(self) -> int: ...
if sys.version_info >= (3, 9):
def __ceil__(self) -> int: ...
@@ -371,7 +371,7 @@ class str(Sequence[str]):
def ljust(self, __width: SupportsIndex, __fillchar: str = ...) -> str: ...
def lower(self) -> str: ...
def lstrip(self, __chars: str | None = ...) -> str: ...
def partition(self, __sep: str) -> Tuple[str, str, str]: ...
def partition(self, __sep: str) -> tuple[str, str, str]: ...
def replace(self, __old: str, __new: str, __count: SupportsIndex = ...) -> str: ...
if sys.version_info >= (3, 9):
def removeprefix(self, __prefix: str) -> str: ...
@@ -379,7 +379,7 @@ class str(Sequence[str]):
def rfind(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
def rindex(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
def rjust(self, __width: SupportsIndex, __fillchar: str = ...) -> str: ...
def rpartition(self, __sep: str) -> Tuple[str, str, str]: ...
def rpartition(self, __sep: str) -> tuple[str, str, str]: ...
def rsplit(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> list[str]: ...
def rstrip(self, __chars: str | None = ...) -> str: ...
def split(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> list[str]: ...
@@ -417,7 +417,7 @@ class str(Sequence[str]):
def __repr__(self) -> str: ...
def __rmul__(self, n: SupportsIndex) -> str: ...
def __str__(self) -> str: ...
def __getnewargs__(self) -> Tuple[str]: ...
def __getnewargs__(self) -> tuple[str]: ...
class bytes(ByteString):
@overload
@@ -466,7 +466,7 @@ class bytes(ByteString):
def ljust(self, __width: SupportsIndex, __fillchar: bytes = ...) -> bytes: ...
def lower(self) -> bytes: ...
def lstrip(self, __bytes: bytes | None = ...) -> bytes: ...
def partition(self, __sep: bytes) -> Tuple[bytes, bytes, bytes]: ...
def partition(self, __sep: bytes) -> tuple[bytes, bytes, bytes]: ...
def replace(self, __old: bytes, __new: bytes, __count: SupportsIndex = ...) -> bytes: ...
if sys.version_info >= (3, 9):
def removeprefix(self, __prefix: bytes) -> bytes: ...
@@ -478,7 +478,7 @@ class bytes(ByteString):
self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
) -> int: ...
def rjust(self, __width: SupportsIndex, __fillchar: bytes = ...) -> bytes: ...
def rpartition(self, __sep: bytes) -> Tuple[bytes, bytes, bytes]: ...
def rpartition(self, __sep: bytes) -> tuple[bytes, bytes, bytes]: ...
def rsplit(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> list[bytes]: ...
def rstrip(self, __bytes: bytes | None = ...) -> bytes: ...
def split(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> list[bytes]: ...
@@ -517,7 +517,7 @@ class bytes(ByteString):
def __le__(self, x: bytes) -> bool: ...
def __gt__(self, x: bytes) -> bool: ...
def __ge__(self, x: bytes) -> bool: ...
def __getnewargs__(self) -> Tuple[bytes]: ...
def __getnewargs__(self) -> tuple[bytes]: ...
class bytearray(MutableSequence[int], ByteString):
@overload
@@ -568,7 +568,7 @@ class bytearray(MutableSequence[int], ByteString):
def ljust(self, __width: SupportsIndex, __fillchar: bytes = ...) -> bytearray: ...
def lower(self) -> bytearray: ...
def lstrip(self, __bytes: bytes | None = ...) -> bytearray: ...
def partition(self, __sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
def partition(self, __sep: bytes) -> tuple[bytearray, bytearray, bytearray]: ...
if sys.version_info >= (3, 9):
def removeprefix(self, __prefix: bytes) -> bytearray: ...
def removesuffix(self, __suffix: bytes) -> bytearray: ...
@@ -580,7 +580,7 @@ class bytearray(MutableSequence[int], ByteString):
self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
) -> int: ...
def rjust(self, __width: SupportsIndex, __fillchar: bytes = ...) -> bytearray: ...
def rpartition(self, __sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
def rpartition(self, __sep: bytes) -> tuple[bytearray, bytearray, bytearray]: ...
def rsplit(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> list[bytearray]: ...
def rstrip(self, __bytes: bytes | None = ...) -> bytearray: ...
def split(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> list[bytearray]: ...
@@ -698,7 +698,7 @@ class bool(int):
def __rxor__(self, x: bool) -> bool: ...
@overload
def __rxor__(self, x: int) -> int: ...
def __getnewargs__(self) -> Tuple[int]: ...
def __getnewargs__(self) -> tuple[int]: ...
class slice(object):
start: Any
@@ -709,7 +709,7 @@ class slice(object):
@overload
def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ...
__hash__: None # type: ignore
def indices(self, len: SupportsIndex) -> Tuple[int, int, int]: ...
def indices(self, len: SupportsIndex) -> tuple[int, int, int]: ...
class tuple(Sequence[_T_co], Generic[_T_co]):
def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ...
@@ -811,7 +811,7 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
@overload
def __init__(self, map: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ...
@overload
def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
def __init__(self, iterable: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
# Next overload is for dict(string.split(sep) for string in iterable)
# Cannot be Iterable[Sequence[_T]] or otherwise dict(["foo", "bar", "baz"]) is not an error
@overload
@@ -819,12 +819,12 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ...
def clear(self) -> None: ...
def copy(self) -> dict[_KT, _VT]: ...
def popitem(self) -> Tuple[_KT, _VT]: ...
def popitem(self) -> tuple[_KT, _VT]: ...
def setdefault(self, __key: _KT, __default: _VT = ...) -> _VT: ...
@overload
def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
@overload
def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
def update(self, __m: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
@overload
def update(self, **kwargs: _VT) -> None: ...
def keys(self) -> _dict_keys[_KT, _VT]: ...
@@ -917,8 +917,8 @@ class frozenset(AbstractSet[_T_co], Generic[_T_co]):
class enumerate(Iterator[Tuple[int, _T]], Generic[_T]):
def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ...
def __iter__(self) -> Iterator[Tuple[int, _T]]: ...
def __next__(self) -> Tuple[int, _T]: ...
def __iter__(self) -> Iterator[tuple[int, _T]]: ...
def __next__(self) -> tuple[int, _T]: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
@@ -1327,13 +1327,13 @@ def vars(__object: Any = ...) -> dict[str, Any]: ...
class zip(Iterator[_T_co], Generic[_T_co]):
if sys.version_info >= (3, 10):
@overload
def __new__(cls, __iter1: Iterable[_T1], *, strict: bool = ...) -> zip[Tuple[_T1]]: ...
def __new__(cls, __iter1: Iterable[_T1], *, strict: bool = ...) -> zip[tuple[_T1]]: ...
@overload
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], *, strict: bool = ...) -> zip[Tuple[_T1, _T2]]: ...
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], *, strict: bool = ...) -> zip[tuple[_T1, _T2]]: ...
@overload
def __new__(
cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], *, strict: bool = ...
) -> zip[Tuple[_T1, _T2, _T3]]: ...
) -> zip[tuple[_T1, _T2, _T3]]: ...
@overload
def __new__(
cls,
@@ -1343,7 +1343,7 @@ class zip(Iterator[_T_co], Generic[_T_co]):
__iter4: Iterable[_T4],
*,
strict: bool = ...,
) -> zip[Tuple[_T1, _T2, _T3, _T4]]: ...
) -> zip[tuple[_T1, _T2, _T3, _T4]]: ...
@overload
def __new__(
cls,
@@ -1354,7 +1354,7 @@ class zip(Iterator[_T_co], Generic[_T_co]):
__iter5: Iterable[_T5],
*,
strict: bool = ...,
) -> zip[Tuple[_T1, _T2, _T3, _T4, _T5]]: ...
) -> zip[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
@overload
def __new__(
cls,
@@ -1369,15 +1369,15 @@ class zip(Iterator[_T_co], Generic[_T_co]):
) -> zip[Tuple[Any, ...]]: ...
else:
@overload
def __new__(cls, __iter1: Iterable[_T1]) -> zip[Tuple[_T1]]: ...
def __new__(cls, __iter1: Iterable[_T1]) -> zip[tuple[_T1]]: ...
@overload
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> zip[Tuple[_T1, _T2]]: ...
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> zip[tuple[_T1, _T2]]: ...
@overload
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> zip[Tuple[_T1, _T2, _T3]]: ...
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]]: ...
) -> zip[tuple[_T1, _T2, _T3, _T4]]: ...
@overload
def __new__(
cls,
@@ -1386,7 +1386,7 @@ class zip(Iterator[_T_co], Generic[_T_co]):
__iter3: Iterable[_T3],
__iter4: Iterable[_T4],
__iter5: Iterable[_T5],
) -> zip[Tuple[_T1, _T2, _T3, _T4, _T5]]: ...
) -> zip[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
@overload
def __new__(
cls,