From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 14 Aug 2022 16:02:07 +0000 (-0700) Subject: Clarify asyncio.Runner docs re: loop_factory (GH-95979) X-Git-Tag: v3.11.0rc2~110 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ce1d0093e61605209ed7ce93b541eb42aea6ffc;p=thirdparty%2FPython%2Fcpython.git Clarify asyncio.Runner docs re: loop_factory (GH-95979) (cherry picked from commit e8259e047c42976427b08f100b9d8ba52db7ee69) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> --- diff --git a/Doc/library/asyncio-runner.rst b/Doc/library/asyncio-runner.rst index d0df1db892f9..4abe7b6e087a 100644 --- a/Doc/library/asyncio-runner.rst +++ b/Doc/library/asyncio-runner.rst @@ -75,7 +75,9 @@ Runner context manager :ref:`asyncio-debug-mode` settings. *loop_factory* could be used for overriding the loop creation. - :func:`asyncio.new_event_loop` is used if ``None``. + It is the responsibility of the *loop_factory* to set the created loop as the + current one. By default :func:`asyncio.new_event_loop` is used and set as + current event loop with :func:`asyncio.set_event_loop` if *loop_factory* is ``None``. Basically, :func:`asyncio.run()` example can be rewritten with the runner usage::