Skip to content

bpo-28516: contextlib.ExitStack.__enter__ has trivial but undocument… #31636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 28, 2022
3 changes: 3 additions & 0 deletions Doc/library/contextlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand Down