Skip to content

Commit 86384cf

Browse files
bpo-28516: document contextlib.ExitStack.__enter__ behavior (pythonGH-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 <[email protected]>
1 parent 76f14b0 commit 86384cf

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
@@ -502,6 +502,9 @@ Functions and classes provided:
502502
# the with statement, even if attempts to open files later
503503
# in the list raise an exception
504504

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

0 commit comments

Comments
 (0)