[Python-checkins] Clarify that AsyncExitStack works with coroutine functions (GH-9405) (GH-9408)
Ned Deily
webhook-mailer at python.org
Fri Oct 5 22:29:20 EDT 2018
https://github.com/python/cpython/commit/414d58f7450f04a12676aefbc650599930aeaca9
commit: 414d58f7450f04a12676aefbc650599930aeaca9
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Ned Deily <nad at python.org>
date: 2018-10-05T22:29:17-04:00
summary:
Clarify that AsyncExitStack works with coroutine functions (GH-9405) (GH-9408)
The docs were ambiguous about whether you pass in a coroutine function
or a coroutine object, e.g. is it:
aestack.push_async_exit(some_async_func)
or
aestack.push_async_exit(some_async_func())
(It's the first one.)
(cherry picked from commit a3c88ef12c7b8993912750b56a1e095652fe47c0)
Co-authored-by: Nathaniel J. Smith <njs at pobox.com>
files:
M Doc/library/contextlib.rst
diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst
index 7dc5b2989f9c..930c97358e08 100644
--- a/Doc/library/contextlib.rst
+++ b/Doc/library/contextlib.rst
@@ -471,11 +471,11 @@ Functions and classes provided:
.. method:: push_async_exit(exit)
Similar to :meth:`push` but expects either an asynchronous context manager
- or a coroutine.
+ or a coroutine function.
.. method:: push_async_callback(callback, *args, **kwds)
- Similar to :meth:`callback` but expects a coroutine.
+ Similar to :meth:`callback` but expects a coroutine function.
.. method:: aclose()
More information about the Python-checkins
mailing list