Skip to content

Commit 47fd0fe

Browse files
committed
Add documentation about availability of 'with' statement
1 parent 8d1a9aa commit 47fd0fe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Doc/library/mailbox.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ Supported mailbox formats are Maildir, mbox, MH, Babyl, and MMDF.
7676
message. Failing to lock the mailbox runs the risk of losing messages or
7777
corrupting the entire mailbox.
7878

79+
The :class:`Mailbox` class supports the :keyword:`with` statement. When used
80+
like this, the Mailbox :meth:`close` method is called automatically when the
81+
:keyword:`with` statement exits.
82+
83+
.. versionchanged:: 3.7
84+
Support for the :keyword:`with` statement was added.
85+
7986
:class:`Mailbox` instances have the following methods:
8087

8188

0 commit comments

Comments
 (0)