]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-125289: Update sample code in asyncio-task.rst (GH-125292)
authorGhorban M. Tavakoly <58617996+galmyk@users.noreply.github.com>
Sat, 12 Oct 2024 20:38:13 +0000 (00:08 +0330)
committerGitHub <noreply@github.com>
Sat, 12 Oct 2024 20:38:13 +0000 (13:38 -0700)
* 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>
Doc/library/asyncio-task.rst

index 4716a3f9c8ac79f05b3a38b2850d822326b2f80e..f27e858cf420f4bf3a925abcc3e96c01042e522c 100644 (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".