Use _typeshed.Self with __enter__ (#5723)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
Anton Grübel
2021-07-04 20:10:01 +02:00
committed by GitHub
parent 1a131a489e
commit d68701c0ec
10 changed files with 32 additions and 22 deletions

View File

@@ -6,6 +6,7 @@ from _typeshed import (
OpenBinaryModeUpdating,
OpenBinaryModeWriting,
OpenTextMode,
Self,
StrOrBytesPath,
StrPath,
)
@@ -860,7 +861,7 @@ if sys.version_info >= (3, 8):
path: Optional[str]
def __init__(self, path: Optional[str], cookie: _T, remove_dll_directory: Callable[[_T], Any]) -> None: ...
def close(self) -> None: ...
def __enter__(self: _T) -> _T: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, *args: Any) -> None: ...
def add_dll_directory(path: str) -> _AddedDllDirectory: ...
if sys.platform == "linux":