Improve accuracy of six byte index methods (#9117)

This commit is contained in:
Samuel T
2022-11-09 22:22:33 -05:00
committed by GitHub
parent 0ac98f6b80
commit 796bdc2eb0
6 changed files with 41 additions and 20 deletions

View File

@@ -67,8 +67,11 @@ class mmap(Iterable[int], Sized):
def __setitem__(self, __index: int, __object: int) -> None: ...
@overload
def __setitem__(self, __index: slice, __object: ReadableBuffer) -> None: ...
# Doesn't actually exist, but the object is actually iterable because it has __getitem__ and
# __len__, so we claim that there is also an __iter__ to help type checkers.
# Doesn't actually exist, but the object actually supports "in" because it has __getitem__,
# so we claim that there is also a __contains__ to help type checkers.
def __contains__(self, __o: object) -> bool: ...
# Doesn't actually exist, but the object is actually iterable because it has __getitem__ and __len__,
# so we claim that there is also an __iter__ to help type checkers.
def __iter__(self) -> Iterator[int]: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, *args: object) -> None: ...