]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-28516: document contextlib.ExitStack.__enter__ behavior (GH-31636)
authorvidhya <96202776+Vidhyavinu@users.noreply.github.com>
Mon, 28 Mar 2022 04:31:32 +0000 (00:31 -0400)
committerGitHub <noreply@github.com>
Mon, 28 Mar 2022 04:31:32 +0000 (21:31 -0700)
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>
Doc/library/contextlib.rst

index bb93088b3429e21eb223991adc2029ed58bcfcd2..38134c1f14319f326553b040b15587269362cea4 100644 (file)
@@ -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*