diff options
author | vidhya <96202776+Vidhyavinu@users.noreply.github.com> | 2022-03-28 04:31:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-28 04:31:32 (GMT) |
commit | 86384cf83f96fcaec03e2ad6516e2e24f20d3b92 (patch) | |
tree | a453164d8a45e492402bf9ef8c88a287d4d4dc56 /Doc/library/contextlib.rst | |
parent | 76f14b0463dc2c53911eaf95e85374e511ba9bcc (diff) | |
download | cpython-86384cf83f96fcaec03e2ad6516e2e24f20d3b92.zip cpython-86384cf83f96fcaec03e2ad6516e2e24f20d3b92.tar.gz cpython-86384cf83f96fcaec03e2ad6516e2e24f20d3b92.tar.bz2 |
bpo-28516: document contextlib.ExitStack.__enter__ behavior (GH-31636)
The enter_context is updated with following information: 'The :meth:`__enter__` method
returns the ExitStack instance, and performs no additional operations.'
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Doc/library/contextlib.rst')
-rw-r--r-- | Doc/library/contextlib.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst index bb93088..38134c1 100644 --- a/Doc/library/contextlib.rst +++ b/Doc/library/contextlib.rst @@ -502,6 +502,9 @@ Functions and classes provided: # the with statement, even if attempts to open files later # in the list raise an exception + The :meth:`__enter__` method returns the :class:`ExitStack` instance, and + performs no additional operations. + Each instance maintains a stack of registered callbacks that are called in reverse order when the instance is closed (either explicitly or implicitly at the end of a :keyword:`with` statement). Note that callbacks are *not* |