From e24c73e71e952028bc702a741241ff79c23eb30e Mon Sep 17 00:00:00 2001 From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Date: Mon, 23 Jan 2023 17:22:38 +0530 Subject: [PATCH] [3.10] Added asyncio REPL example to docs. (GH-101243) (#101257) (cherry picked from commit 5d868efde9ea08b39357b962a02a0294aa97689c) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Carlton Gibson --- Doc/library/asyncio.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Doc/library/asyncio.rst b/Doc/library/asyncio.rst index a6429394389b..8a6526ed9022 100644 --- a/Doc/library/asyncio.rst +++ b/Doc/library/asyncio.rst @@ -56,6 +56,17 @@ 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' .. We use the "rubric" directive here to avoid creating the "Reference" subsection in the TOC. -- 2.47.3