Skip to content

Commit

Permalink
[3.12] pythongh-125289: Update sample code in asyncio-task.rst (pytho…
Browse files Browse the repository at this point in the history
…nGH-125292) (pythonGH-125375)

pythongh-125289: Update sample code in asyncio-task.rst (pythonGH-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



* Update Doc/library/asyncio-task.rst



---------

(cherry picked from commit fa52b82)

Co-authored-by: Ghorban M. Tavakoly <58617996+galmyk@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
  • Loading branch information
3 people authored Oct 12, 2024
1 parent 331fc01 commit 1d45fae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Doc/library/asyncio-task.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down

0 comments on commit 1d45fae

Please sign in to comment.