mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 04:52:23 +08:00
Use lowercase tuple where possible (#6170)
This commit is contained in:
@@ -86,7 +86,7 @@ class UserString(Sequence[str]):
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
def __complex__(self) -> complex: ...
|
||||
def __getnewargs__(self) -> Tuple[str]: ...
|
||||
def __getnewargs__(self) -> tuple[str]: ...
|
||||
def __lt__(self, string: str | UserString) -> bool: ...
|
||||
def __le__(self, string: str | UserString) -> bool: ...
|
||||
def __gt__(self, string: str | UserString) -> bool: ...
|
||||
@@ -135,7 +135,7 @@ class UserString(Sequence[str]):
|
||||
@staticmethod
|
||||
@overload
|
||||
def maketrans(x: str, y: str, z: str = ...) -> dict[int, int | None]: ...
|
||||
def partition(self, sep: str) -> Tuple[str, str, str]: ...
|
||||
def partition(self, sep: str) -> tuple[str, str, str]: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def removeprefix(self: _UserStringT, __prefix: str | UserString) -> _UserStringT: ...
|
||||
def removesuffix(self: _UserStringT, __suffix: str | UserString) -> _UserStringT: ...
|
||||
@@ -143,7 +143,7 @@ class UserString(Sequence[str]):
|
||||
def rfind(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ...
|
||||
def rindex(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ...
|
||||
def rjust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ...
|
||||
def rpartition(self, sep: str) -> Tuple[str, str, str]: ...
|
||||
def rpartition(self, sep: str) -> tuple[str, str, str]: ...
|
||||
def rstrip(self: _UserStringT, chars: str | None = ...) -> _UserStringT: ...
|
||||
def split(self, sep: str | None = ..., maxsplit: int = ...) -> list[str]: ...
|
||||
def rsplit(self, sep: str | None = ..., maxsplit: int = ...) -> list[str]: ...
|
||||
@@ -207,7 +207,7 @@ class Counter(Dict[_T, int], Generic[_T]):
|
||||
def __init__(self, __iterable: Iterable[_T]) -> None: ...
|
||||
def copy(self: _S) -> _S: ...
|
||||
def elements(self) -> Iterator[_T]: ...
|
||||
def most_common(self, n: int | None = ...) -> list[Tuple[_T, int]]: ...
|
||||
def most_common(self, n: int | None = ...) -> list[tuple[_T, int]]: ...
|
||||
@classmethod
|
||||
def fromkeys(cls, iterable: Any, v: int | None = ...) -> NoReturn: ... # type: ignore
|
||||
@overload
|
||||
@@ -224,7 +224,7 @@ class Counter(Dict[_T, int], Generic[_T]):
|
||||
@overload
|
||||
def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ...
|
||||
@overload
|
||||
def update(self, __m: Iterable[_T] | Iterable[Tuple[_T, int]], **kwargs: int) -> None: ...
|
||||
def update(self, __m: Iterable[_T] | Iterable[tuple[_T, int]], **kwargs: int) -> None: ...
|
||||
@overload
|
||||
def update(self, __m: None = ..., **kwargs: int) -> None: ...
|
||||
def __add__(self, other: Counter[_T]) -> Counter[_T]: ...
|
||||
@@ -242,7 +242,7 @@ class _OrderedDictKeysView(_dict_keys[_KT_co, _VT_co], Reversible[_KT_co]):
|
||||
def __reversed__(self) -> Iterator[_KT_co]: ...
|
||||
|
||||
class _OrderedDictItemsView(_dict_items[_KT_co, _VT_co], Reversible[Tuple[_KT_co, _VT_co]]):
|
||||
def __reversed__(self) -> Iterator[Tuple[_KT_co, _VT_co]]: ...
|
||||
def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ...
|
||||
|
||||
# The generics are the wrong way around because of a mypy limitation
|
||||
# https://github.com/python/mypy/issues/11138
|
||||
@@ -250,7 +250,7 @@ class _OrderedDictValuesView(_dict_values[_VT_co, _KT_co], Reversible[_VT_co], G
|
||||
def __reversed__(self) -> Iterator[_VT_co]: ...
|
||||
|
||||
class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
|
||||
def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ...
|
||||
def popitem(self, last: bool = ...) -> tuple[_KT, _VT]: ...
|
||||
def move_to_end(self, key: _KT, last: bool = ...) -> None: ...
|
||||
def copy(self: _S) -> _S: ...
|
||||
def __reversed__(self) -> Iterator[_KT]: ...
|
||||
@@ -271,9 +271,9 @@ class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
@overload
|
||||
def __init__(self, default_factory: Callable[[], _VT] | None, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
|
||||
@overload
|
||||
def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[Tuple[_KT, _VT]]) -> None: ...
|
||||
def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[tuple[_KT, _VT]]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
|
||||
def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
|
||||
def __missing__(self, key: _KT) -> _VT: ...
|
||||
# TODO __reversed__
|
||||
def copy(self: _S) -> _S: ...
|
||||
|
||||
Reference in New Issue
Block a user