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

@@ -2,7 +2,7 @@ import gzip
import http.client
import sys
import time
from _typeshed import SupportsRead, SupportsWrite
from _typeshed import Self, SupportsRead, SupportsWrite
from datetime import datetime
from io import BytesIO
from types import TracebackType
@@ -301,7 +301,7 @@ class ServerProxy:
def __call__(self, attr: Literal["transport"]) -> Transport: ...
@overload
def __call__(self, attr: str) -> Union[Callable[[], None], Transport]: ...
def __enter__(self) -> ServerProxy: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> None: ...