From: Carlton Gibson Date: Mon, 23 Jan 2023 11:31:13 +0000 (+0100) Subject: Added asyncio REPL example to docs. (#101243) X-Git-Tag: v3.12.0a5~120 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5d868efde9ea08b39357b962a02a0294aa97689c;p=thirdparty%2FPython%2Fcpython.git Added asyncio REPL example to docs. (#101243) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> --- diff --git a/Doc/library/asyncio.rst b/Doc/library/asyncio.rst index b71006e32b2b..c6a046f534e9 100644 --- a/Doc/library/asyncio.rst +++ b/Doc/library/asyncio.rst @@ -56,6 +56,18 @@ Additionally, there are **low-level** APIs for * :ref:`bridge ` 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