Skip to content

Commit 27785f3

Browse files
committed
modify task coro example.
1 parent 0fbd5b1 commit 27785f3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Doc/howto/a-conceptual-overview-of-asyncio.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ to specify the event loop.
170170

171171
::
172172

173+
coroutine = loudmouth_penguin(magic_number=5)
173174
# This creates a Task object and puts it on the event loop's queue.
174-
task = asyncio.create_task(coro=loudmouth_penguin(magic_number=5))
175+
task = asyncio.create_task(coroutine)
175176

176177
Earlier, we manually created the event loop and set it to run forever.
177178
In practice, it's recommended to use (and common to see) :func:`asyncio.run`,

0 commit comments

Comments
 (0)