mirror of https://github.com/python/cpython.git
gh-91048: Improve example in `asyncio-graph.rst` doc (#129224)
This commit is contained in:
parent
0b15d9c0d2
commit
c05a851ac5
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue