Use _typeshed.Self with __enter__ (#5717)

Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
Anton Grübel
2021-07-01 12:32:32 +02:00
committed by GitHub
parent 04f0113d16
commit 96e0660fba
12 changed files with 44 additions and 39 deletions

View File

@@ -1,6 +1,6 @@
import email.message
import sys
from _typeshed import StrOrBytesPath
from _typeshed import Self, StrOrBytesPath
from types import TracebackType
from typing import (
IO,
@@ -189,7 +189,7 @@ class _ProxyFile(Generic[AnyStr]):
def tell(self) -> int: ...
def seek(self, offset: int, whence: int = ...) -> None: ...
def close(self) -> None: ...
def __enter__(self) -> _ProxyFile[AnyStr]: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[TracebackType]
) -> None: ...