diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-12-10 11:20:14 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-12-10 11:20:14 (GMT) |
commit | a6fa15367fc1c17313b7a64eb59b8a8a2bb6d863 (patch) | |
tree | c241929d1797f3ffb43c6d00f24b998ab6e6f3fd /Doc/library/asyncio-task.rst | |
parent | 0839ed4730ef8cca5f680f8192968debe0b99963 (diff) | |
download | cpython-a6fa15367fc1c17313b7a64eb59b8a8a2bb6d863.zip cpython-a6fa15367fc1c17313b7a64eb59b8a8a2bb6d863.tar.gz cpython-a6fa15367fc1c17313b7a64eb59b8a8a2bb6d863.tar.bz2 |
asyncio doc: simplify task example
Diffstat (limited to 'Doc/library/asyncio-task.rst')
-rw-r--r-- | Doc/library/asyncio-task.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 597e42e..afcfea8 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -327,10 +327,10 @@ Example executing 3 tasks (A, B, C) in parallel:: f *= i print("Task %s: factorial(%s) = %s" % (name, number, f)) - task_a = asyncio.Task(factorial("A", 2)) - task_b = asyncio.Task(factorial("B", 3)) - task_c = asyncio.Task(factorial("C", 4)) - tasks = [task_a, task_b, task_c] + tasks = [ + asyncio.Task(factorial("A", 2)), + asyncio.Task(factorial("B", 3)), + asyncio.Task(factorial("C", 4))] loop = asyncio.get_event_loop() loop.run_until_complete(asyncio.wait(tasks)) |