From 92d7ce7ca4ed25c91df9ff9b205939e14f7380a3 Mon Sep 17 00:00:00 2001 From: Forest Date: Mon, 9 Dec 2024 13:35:48 -0800 Subject: [PATCH] docs: imaplib: note: Idler objects require 'with' --- Doc/library/imaplib.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst index 7c47d0b85f5e8d..80a3ec907cccd7 100644 --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -389,6 +389,12 @@ An :class:`IMAP4` instance has the following methods: advised not to use :meth:`Idler.burst() ` with an :class:`IMAP4_stream` connection on Windows. + .. note:: + + The :class:`!Idler` object returned by :meth:`IMAP4.idle` is usable only + within a :keyword:`with` statement. To retrieve unsolicited IMAP + responses outside that context, see :meth:`IMAP4.response`. + .. note:: The :class:`!Idler` class name and structure are internal interfaces,