Use _typeshed.Self with __enter__ (#5712)

This commit is contained in:
Anton Grübel
2021-06-30 00:19:25 +02:00
committed by GitHub
parent 35cc7491db
commit c38171a0b3
8 changed files with 24 additions and 27 deletions

View File

@@ -7,6 +7,7 @@ from _typeshed import (
OpenBinaryModeWriting,
OpenTextMode,
ReadableBuffer,
Self,
StrOrBytesPath,
SupportsDivMod,
SupportsKeysAndGetItem,
@@ -648,7 +649,7 @@ class memoryview(Sized, Sequence[int]):
contiguous: bool
nbytes: int
def __init__(self, obj: ReadableBuffer) -> None: ...
def __enter__(self) -> memoryview: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> None: ...