]> granicus.if.org Git - python/commitdiff
asyncio doc: simplify task example
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 10 Dec 2013 11:20:14 +0000 (12:20 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 10 Dec 2013 11:20:14 +0000 (12:20 +0100)
Doc/library/asyncio-task.rst

index 597e42e333078c6c0a67d64c22758fd74c3c7912..afcfea84a2aad23cb47ca1484aefa99b17d1c131 100644 (file)
@@ -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))