bpo-28516: document contextlib.ExitStack.__enter__ behavior (GH-31636) (GH-32145)

https://github.com/python/cpython/commit/1e3132b1c3ebff8d28a6dd353bf217cb97c... commit: 1e3132b1c3ebff8d28a6dd353bf217cb97c41e81 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> committer: JelleZijlstra <jelle.zijlstra@gmail.com> date: 2022-03-28T11:45:45-07:00 summary: 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 <jelle.zijlstra@gmail.com> (cherry picked from commit 86384cf83f96fcaec03e2ad6516e2e24f20d3b92) Co-authored-by: vidhya <96202776+Vidhyavinu@users.noreply.github.com> Co-authored-by: Ned Deily <nad@python.org> files: M Doc/library/contextlib.rst diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst index 66a0f17a9234b..d471c8ce52796 100644 --- a/Doc/library/contextlib.rst +++ b/Doc/library/contextlib.rst @@ -368,6 +368,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*
participants (1)
-
JelleZijlstra