@@ -24,11 +24,13 @@ Running an asyncio Program
2424
2525.. function :: run(coro, *, debug=None, loop_factory=None)
2626
27- Execute the :term: ` coroutine ` *coro * and return the result.
27+ Execute *coro * in an asyncio event loop and return the result.
2828
29- This function runs the passed coroutine, taking care of
30- managing the asyncio event loop, *finalizing asynchronous
31- generators *, and closing the executor.
29+ The argument can be any awaitable object.
30+
31+ This function runs the awaitable, taking care of managing the
32+ asyncio event loop, *finalizing asynchronous generators *, and
33+ closing the executor.
3234
3335 This function cannot be called when another asyncio event loop is
3436 running in the same thread.
@@ -70,6 +72,10 @@ Running an asyncio Program
7072
7173 Added *loop_factory * parameter.
7274
75+ .. versionchanged :: 3.14
76+
77+ *coro * can be any awaitable object.
78+
7379
7480Runner context manager
7581======================
@@ -104,17 +110,25 @@ Runner context manager
104110
105111 .. method :: run(coro, *, context=None)
106112
107- Run a :term: `coroutine <coroutine> ` *coro * in the embedded loop.
113+ Execute *coro * in the embedded event loop.
114+
115+ The argument can be any awaitable object.
108116
109- Return the coroutine's result or raise its exception .
117+ If the argument is a coroutine, it is wrapped in a Task .
110118
111119 An optional keyword-only *context * argument allows specifying a
112- custom :class: `contextvars.Context ` for the *coro * to run in.
113- The runner's default context is used if ``None ``.
120+ custom :class: `contextvars.Context ` for the code to run in.
121+ The runner's default context is used if context is ``None ``.
122+
123+ Returns the awaitable's result or raises an exception.
114124
115125 This function cannot be called when another asyncio event loop is
116126 running in the same thread.
117127
128+ .. versionchanged :: 3.14
129+
130+ *coro * can be any awaitable object.
131+
118132 .. method :: close()
119133
120134 Close the runner.
0 commit comments