Skip to content

Commit 836fbcc

Browse files
committed
imaplib: append returns a tuple (status, [data])
According to the docstring for append: ``` (typ, [data]) = <instance>.append(mailbox, flags, date_time, message) ``` [v3.0](https://github.com/python/cpython/blob/v3.0/Lib/imaplib.py#L313) [v3.14](https://github.com/python/cpython/blob/v3.14.0/Lib/imaplib.py#L483) Further corroborated that this is a tuple of some sort because append returns the result of `self._simple_command(...)`, which returns the result of `self._command_complete(...)`, which returns `typ, data`.
1 parent 6b4691d commit 836fbcc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/imaplib.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class IMAP4:
6161
def socket(self) -> _socket: ...
6262
def recent(self) -> _CommandResults: ...
6363
def response(self, code: str) -> _CommandResults: ...
64-
def append(self, mailbox: str, flags: str, date_time: str, message: ReadableBuffer) -> str: ...
64+
def append(self, mailbox: str, flags: str, date_time: str, message: ReadableBuffer) -> tuple[str, list[bytes]]: ...
6565
def authenticate(self, mechanism: str, authobject: Callable[[bytes], bytes | None]) -> tuple[str, str]: ...
6666
def capability(self) -> _CommandResults: ...
6767
def check(self) -> _CommandResults: ...

0 commit comments

Comments
 (0)