]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Clarify that AsyncExitStack works with coroutine functions (GH-9405) (GH-9408)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 6 Oct 2018 02:29:17 +0000 (19:29 -0700)
committerNed Deily <nad@python.org>
Sat, 6 Oct 2018 02:29:17 +0000 (22:29 -0400)
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@pobox.com>
Doc/library/contextlib.rst

index 7dc5b2989f9c0c02915e32cc6a6cf25efb9c7da8..930c97358e080d7c31fb0974780298b49642d605 100644 (file)
@@ -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()