summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Waygood <Alex.Waygood@Gmail.com>2023-12-08 14:03:15 (GMT)
committerGitHub <noreply@github.com>2023-12-08 14:03:15 (GMT)
commit23234e92236dbb5def20e91d6c5c923483a7506b (patch)
treeb1cf487cd45f519769f20d07fbbc8feaa147228f
parent161cfd0dda63ec14a1674761fe33f093eaafc370 (diff)
downloadcpython-23234e92236dbb5def20e91d6c5c923483a7506b.zip
cpython-23234e92236dbb5def20e91d6c5c923483a7506b.tar.gz
cpython-23234e92236dbb5def20e91d6c5c923483a7506b.tar.bz2
[3.11] gh-101100: Fix Sphinx nits in `library/contextlib.rst` (#112870) (#112874)
(cherry-picked from commit e4c087603397a1314253b861d35f8314fba8ae92)
-rw-r--r--Doc/library/contextlib.rst14
-rw-r--r--Doc/tools/.nitignore1
2 files changed, 7 insertions, 8 deletions
diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst
index 80a683d..c01112a 100644
--- a/Doc/library/contextlib.rst
+++ b/Doc/library/contextlib.rst
@@ -106,8 +106,8 @@ Functions and classes provided:
This function is a :term:`decorator` that can be used to define a factory
function for :keyword:`async with` statement asynchronous context managers,
- without needing to create a class or separate :meth:`__aenter__` and
- :meth:`__aexit__` methods. It must be applied to an :term:`asynchronous
+ without needing to create a class or separate :meth:`~object.__aenter__` and
+ :meth:`~object.__aexit__` methods. It must be applied to an :term:`asynchronous
generator` function.
A simple example::
@@ -609,12 +609,12 @@ Functions and classes provided:
asynchronous context managers, as well as having coroutines for
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.
.. 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.
.. versionchanged:: 3.11
@@ -623,16 +623,16 @@ Functions and classes provided:
.. 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.
.. 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()
- Similar to :meth:`close` but properly handles awaitables.
+ Similar to :meth:`ExitStack.close` but properly handles awaitables.
Continuing the example for :func:`asynccontextmanager`::
diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore
index 68fd981..3a9d182 100644
--- a/Doc/tools/.nitignore
+++ b/Doc/tools/.nitignore
@@ -39,7 +39,6 @@ Doc/library/collections.abc.rst
Doc/library/collections.rst
Doc/library/concurrent.futures.rst
Doc/library/configparser.rst
-Doc/library/contextlib.rst
Doc/library/copy.rst
Doc/library/csv.rst
Doc/library/ctypes.rst