Added asyncio REPL example to docs. (#101243)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
This commit is contained in:
Carlton Gibson 2023-01-23 12:31:13 +01:00 committed by GitHub
parent 807d6b576f
commit 5d868efde9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -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