]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-79964: Clarify the imaplib fetch example in the docs (GH-152780)
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 2 Jul 2026 07:18:51 +0000 (10:18 +0300)
committerGitHub <noreply@github.com>
Thu, 2 Jul 2026 07:18:51 +0000 (10:18 +0300)
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>
Doc/library/imaplib.rst

index df2468f7124e6d689ad7d52990953d448f366958..01de1bc393c5bb2d66455d96bbf00d960f16087f 100644 (file)
@@ -730,3 +730,10 @@ retrieves and prints all messages::
    M.close()
    M.logout()
 
+.. note::
+
+   A ``FETCH`` response may contain additional or unsolicited data
+   (see :rfc:`3501`, section 7.4.2),
+   so production code should inspect the whole response
+   rather than rely on ``data[0][1]``.
+