Skip to content

Commit 604d003

Browse files
[3.10] bpo-28516: document contextlib.ExitStack.__enter__ behavior (GH-31636) (GH-32171)
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]>
1 parent 0dfabf9 commit 604d003

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

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

0 commit comments

Comments
 (0)