Skip to content

Commit

Permalink
Added asyncio REPL example to docs. (#101243)
Browse files Browse the repository at this point in the history
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
  • Loading branch information
carltongibson and kumaraditya303 authored Jan 23, 2023
1 parent 807d6b5 commit 5d868ef
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Doc/library/asyncio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ Additionally, there are **low-level** APIs for
* :ref:`bridge <asyncio-futures>` callback-based libraries and code
with async/await syntax.

You can experiment with an ``asyncio`` concurrent context in the REPL:

.. code-block:: pycon
$ python -m asyncio
asyncio REPL ...
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> await asyncio.sleep(10, result='hello')
'hello'
.. include:: ../includes/wasm-notavail.rst

.. We use the "rubric" directive here to avoid creating
Expand Down

0 comments on commit 5d868ef

Please sign in to comment.