]> granicus.if.org Git - python/commitdiff
Clarify that AsyncExitStack works with coroutine functions (GH-9405)
authorNathaniel J. Smith <njs@pobox.com>
Tue, 18 Sep 2018 21:27:59 +0000 (14:27 -0700)
committerCarol Willing <carolcode@willingconsulting.com>
Tue, 18 Sep 2018 21:27:59 +0000 (14:27 -0700)
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.)

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()