Skip to content

Commit 5d868ef

Browse files
Added asyncio REPL example to docs. (#101243)
Co-authored-by: Kumar Aditya <[email protected]>
1 parent 807d6b5 commit 5d868ef

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Doc/library/asyncio.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ Additionally, there are **low-level** APIs for
5656
* :ref:`bridge <asyncio-futures>` callback-based libraries and code
5757
with async/await syntax.
5858

59+
You can experiment with an ``asyncio`` concurrent context in the REPL:
60+
61+
.. code-block:: pycon
62+
63+
$ python -m asyncio
64+
asyncio REPL ...
65+
Use "await" directly instead of "asyncio.run()".
66+
Type "help", "copyright", "credits" or "license" for more information.
67+
>>> import asyncio
68+
>>> await asyncio.sleep(10, result='hello')
69+
'hello'
70+
5971
.. include:: ../includes/wasm-notavail.rst
6072

6173
.. We use the "rubric" directive here to avoid creating

0 commit comments

Comments
 (0)