mirror of https://github.com/python/cpython
gh-101100: Fix Sphinx nits in `library/contextlib.rst` (#112870)
This commit is contained in:
parent
3cdcc2edf8
commit
e4c0876033
|
@ -106,8 +106,8 @@ Functions and classes provided:
|
||||||
|
|
||||||
This function is a :term:`decorator` that can be used to define a factory
|
This function is a :term:`decorator` that can be used to define a factory
|
||||||
function for :keyword:`async with` statement asynchronous context managers,
|
function for :keyword:`async with` statement asynchronous context managers,
|
||||||
without needing to create a class or separate :meth:`__aenter__` and
|
without needing to create a class or separate :meth:`~object.__aenter__` and
|
||||||
:meth:`__aexit__` methods. It must be applied to an :term:`asynchronous
|
:meth:`~object.__aexit__` methods. It must be applied to an :term:`asynchronous
|
||||||
generator` function.
|
generator` function.
|
||||||
|
|
||||||
A simple example::
|
A simple example::
|
||||||
|
@ -616,12 +616,12 @@ Functions and classes provided:
|
||||||
asynchronous context managers, as well as having coroutines for
|
asynchronous context managers, as well as having coroutines for
|
||||||
cleanup logic.
|
cleanup logic.
|
||||||
|
|
||||||
The :meth:`close` method is not implemented, :meth:`aclose` must be used
|
The :meth:`~ExitStack.close` method is not implemented; :meth:`aclose` must be used
|
||||||
instead.
|
instead.
|
||||||
|
|
||||||
.. coroutinemethod:: enter_async_context(cm)
|
.. coroutinemethod:: enter_async_context(cm)
|
||||||
|
|
||||||
Similar to :meth:`enter_context` but expects an asynchronous context
|
Similar to :meth:`ExitStack.enter_context` but expects an asynchronous context
|
||||||
manager.
|
manager.
|
||||||
|
|
||||||
.. versionchanged:: 3.11
|
.. versionchanged:: 3.11
|
||||||
|
@ -630,16 +630,16 @@ Functions and classes provided:
|
||||||
|
|
||||||
.. method:: push_async_exit(exit)
|
.. method:: push_async_exit(exit)
|
||||||
|
|
||||||
Similar to :meth:`push` but expects either an asynchronous context manager
|
Similar to :meth:`ExitStack.push` but expects either an asynchronous context manager
|
||||||
or a coroutine function.
|
or a coroutine function.
|
||||||
|
|
||||||
.. method:: push_async_callback(callback, /, *args, **kwds)
|
.. method:: push_async_callback(callback, /, *args, **kwds)
|
||||||
|
|
||||||
Similar to :meth:`callback` but expects a coroutine function.
|
Similar to :meth:`ExitStack.callback` but expects a coroutine function.
|
||||||
|
|
||||||
.. coroutinemethod:: aclose()
|
.. coroutinemethod:: aclose()
|
||||||
|
|
||||||
Similar to :meth:`close` but properly handles awaitables.
|
Similar to :meth:`ExitStack.close` but properly handles awaitables.
|
||||||
|
|
||||||
Continuing the example for :func:`asynccontextmanager`::
|
Continuing the example for :func:`asynccontextmanager`::
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,6 @@ Doc/library/collections.abc.rst
|
||||||
Doc/library/collections.rst
|
Doc/library/collections.rst
|
||||||
Doc/library/concurrent.futures.rst
|
Doc/library/concurrent.futures.rst
|
||||||
Doc/library/configparser.rst
|
Doc/library/configparser.rst
|
||||||
Doc/library/contextlib.rst
|
|
||||||
Doc/library/csv.rst
|
Doc/library/csv.rst
|
||||||
Doc/library/datetime.rst
|
Doc/library/datetime.rst
|
||||||
Doc/library/dbm.rst
|
Doc/library/dbm.rst
|
||||||
|
|
Loading…
Reference in New Issue