Skip to content

Commit 1e3132b

Browse files
miss-islingtonVidhyavinuned-deily
authored
bpo-28516: document contextlib.ExitStack.__enter__ behavior (GH-31636) (GH-32145)
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 <[email protected]> (cherry picked from commit 86384cf) Co-authored-by: vidhya <[email protected]> Co-authored-by: Ned Deily <[email protected]>
1 parent 25c40bd commit 1e3132b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Doc/library/contextlib.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ Functions and classes provided:
368368
# the with statement, even if attempts to open files later
369369
# in the list raise an exception
370370

371+
The :meth:`__enter__` method returns the :class:`ExitStack` instance, and
372+
performs no additional operations.
373+
371374
Each instance maintains a stack of registered callbacks that are called in
372375
reverse order when the instance is closed (either explicitly or implicitly
373376
at the end of a :keyword:`with` statement). Note that callbacks are *not*

0 commit comments

Comments
 (0)