Use _typeshed.Self with __enter__ (#5719)

This commit is contained in:
Anton Grübel
2021-07-01 23:15:13 +02:00
committed by GitHub
parent 96e0660fba
commit 8a107464a8
11 changed files with 30 additions and 45 deletions

View File

@@ -1,4 +1,5 @@
import socket
from _typeshed import Self
from typing import Any, Callable, Match, Optional, Pattern, Sequence, Tuple, Union
DEBUGLEVEL: int
@@ -109,5 +110,5 @@ class Telnet:
def expect(
self, list: Sequence[Union[Pattern[bytes], bytes]], timeout: Optional[float] = ...
) -> Tuple[int, Optional[Match[bytes]], bytes]: ...
def __enter__(self) -> Telnet: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ...