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

@@ -1,3 +1,4 @@
from _typeshed import Self
from email.message import Message
from types import TracebackType
from typing import IO, Any, BinaryIO, Callable, Iterable, List, Optional, Tuple, Type, TypeVar
@@ -7,7 +8,7 @@ _AIUT = TypeVar("_AIUT", bound=addbase)
class addbase(BinaryIO):
fp: IO[bytes]
def __init__(self, fp: IO[bytes]) -> None: ...
def __enter__(self: _AIUT) -> _AIUT: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]
) -> None: ...