Clarify asyncio.Runner docs re: loop_factory (GH-95979)

(cherry picked from commit e8259e047c)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2022-08-14 09:02:07 -07:00 committed by GitHub
parent 38882d97b3
commit 3ce1d0093e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

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