gh-125289: Update sample code in asyncio-task.rst (GH-125292)

* Update sample code in asyncio-task.rst

This will change **coroutines** sample code in the **Awaitables** section and make the example clearer.

* Update Doc/library/asyncio-task.rst

Revert the added print

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>

* Update Doc/library/asyncio-task.rst

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>

---------

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
This commit is contained in:
Ghorban M. Tavakoly 2024-10-13 00:08:13 +03:30 committed by GitHub
parent 4a2282b067
commit fa52b82c91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -158,7 +158,7 @@ other coroutines::
# Nothing happens if we just call "nested()".
# A coroutine object is created but not awaited,
# so it *won't run at all*.
nested()
nested() # will raise a "RuntimeWarning".
# Let's do it differently now and await it:
print(await nested()) # will print "42".