From 5bc5b1a7ce8d42548ca71af9d0863fc1a1efdd3e Mon Sep 17 00:00:00 2001 From: savagemechanic <20458938+savagemechanic@users.noreply.github.com> Date: Sun, 17 May 2026 23:12:29 +0100 Subject: [PATCH] gh-149930: Clarify imaplib response helper types --- Doc/library/imaplib.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst index df2468f7124e6d..2c1911cf096915 100644 --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -120,11 +120,11 @@ The second subclass allows for connections created by a child process: The following utility functions are defined: -.. function:: Internaldate2tuple(datestr) +.. function:: Internaldate2tuple(resp) - Parse an IMAP4 ``INTERNALDATE`` string and return corresponding local - time. The return value is a :class:`time.struct_time` tuple or - ``None`` if the string has wrong format. + Parse a :term:`bytes-like object` containing an IMAP4 ``INTERNALDATE`` + response and return the corresponding local time. The return value is a + :class:`time.struct_time` tuple or ``None`` if the input has wrong format. .. function:: Int2AP(num) @@ -132,9 +132,11 @@ The following utility functions are defined: [``A`` .. ``P``]. -.. function:: ParseFlags(flagstr) +.. function:: ParseFlags(resp) - Converts an IMAP4 ``FLAGS`` response to a tuple of individual flags. + Converts a :term:`bytes-like object` containing an IMAP4 ``FLAGS`` response + to a tuple of individual flags as :class:`bytes`. The return value is an + empty tuple if the input has wrong format. .. function:: Time2Internaldate(date_time) @@ -729,4 +731,3 @@ retrieves and prints all messages:: print('Message %s\n%s\n' % (num, data[0][1])) M.close() M.logout() -