Skip to content

Commit 50ae0be

Browse files
gh-79964: Clarify the imaplib fetch example in the docs (GH-152780)
A FETCH response may contain additional or unsolicited data, so the message is not always data[0][1]. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 262b6a0 commit 50ae0be

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Doc/library/imaplib.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,3 +730,10 @@ retrieves and prints all messages::
730730
M.close()
731731
M.logout()
732732

733+
.. note::
734+
735+
A ``FETCH`` response may contain additional or unsolicited data
736+
(see :rfc:`3501`, section 7.4.2),
737+
so production code should inspect the whole response
738+
rather than rely on ``data[0][1]``.
739+

0 commit comments

Comments
 (0)