Use _typeshed.Self where __enter__ returns self (#5698)

This commit is contained in:
Dominic Davis-Foster
2021-06-27 20:58:58 +01:00
committed by GitHub
parent 1fb100dca4
commit 58559e56b3
7 changed files with 16 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
import subprocess
import sys
import time
from _typeshed import Self
from socket import socket as _socket
from ssl import SSLContext, SSLSocket
from types import TracebackType
@@ -59,7 +60,7 @@ class IMAP4:
def delete(self, mailbox: str) -> _CommandResults: ...
def deleteacl(self, mailbox: str, who: str) -> _CommandResults: ...
def enable(self, capability: str) -> _CommandResults: ...
def __enter__(self) -> IMAP4: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, t: Optional[Type[BaseException]], v: Optional[BaseException], tb: Optional[TracebackType]) -> None: ...
def expunge(self) -> _CommandResults: ...
def fetch(self, message_set: str, message_parts: str) -> Tuple[str, _AnyResponseData]: ...