]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91048: Improve example in `asyncio-graph.rst` doc (#129224)
authorsobolevn <mail@sobolevn.me>
Thu, 23 Jan 2025 18:08:51 +0000 (21:08 +0300)
committerGitHub <noreply@github.com>
Thu, 23 Jan 2025 18:08:51 +0000 (23:38 +0530)
Doc/library/asyncio-graph.rst

index fc8edeb426c567baf39bfffdaa9d0d37c3316e37..814bfe6e269bf92e151f756bbba437cd95a2eae1 100644 (file)
@@ -59,13 +59,13 @@ and debuggers.
 
       async def main():
           async with asyncio.TaskGroup() as g:
-              g.create_task(test())
+              g.create_task(test(), name='test')
 
       asyncio.run(main())
 
    will print::
 
-      * Task(name='Task-2', id=0x1039f0fe0)
+      * Task(name='test', id=0x1039f0fe0)
       + Call stack:
       |   File 't2.py', line 4, in async test()
       + Awaited by: