Add __enter__, __exit__ to IMAP4, make __init__ arguments optional (#3540)

Fixes #3537
This commit is contained in:
Reid Swan
2019-12-13 13:05:57 +02:00
committed by Sebastian Rittau
parent fda384fe0a
commit 3e638aa3c3

View File

@@ -29,7 +29,7 @@ class IMAP4:
welcome: bytes = ...
capabilities: Tuple[str] = ...
PROTOCOL_VERSION: str = ...
def __init__(self, host: str, port: int) -> None: ...
def __init__(self, host: str = ..., port: int = ...) -> None: ...
def __getattr__(self, attr: str) -> Any: ...
host: str = ...
port: int = ...
@@ -54,6 +54,8 @@ class IMAP4:
def deleteacl(self, mailbox: str, who: str) -> CommandResults: ...
if sys.version_info >= (3, 5):
def enable(self, capability: str) -> CommandResults: ...
def __enter__(self) -> IMAP4: ...
def __exit__(self, *args) -> None: ...
def expunge(self) -> CommandResults: ...
def fetch(self, message_set: str, message_parts: str) -> CommandResults: ...
def getacl(self, mailbox: str) -> CommandResults: ...