Improve stubs for sequence types (#6386)

This commit is contained in:
Alex Waygood
2021-11-27 03:09:38 +00:00
committed by GitHub
parent 6130c2459e
commit 98af7d667f
9 changed files with 32 additions and 29 deletions

View File

@@ -424,7 +424,7 @@ class str(Sequence[str]):
def __contains__(self, __o: str) -> bool: ... # type: ignore[override]
def __eq__(self, __x: object) -> bool: ...
def __ge__(self, __x: str) -> bool: ...
def __getitem__(self, __i: int | slice) -> str: ...
def __getitem__(self, __i: SupportsIndex | slice) -> str: ...
def __gt__(self, __x: str) -> bool: ...
def __hash__(self) -> int: ...
def __iter__(self) -> Iterator[str]: ...
@@ -740,7 +740,7 @@ class tuple(Sequence[_T_co], Generic[_T_co]):
def __len__(self) -> int: ...
def __contains__(self, __x: object) -> bool: ...
@overload
def __getitem__(self, __x: int) -> _T_co: ...
def __getitem__(self, __x: SupportsIndex) -> _T_co: ...
@overload
def __getitem__(self, __x: slice) -> Tuple[_T_co, ...]: ...
def __iter__(self) -> Iterator[_T_co]: ...