Clarify asyncio.Runner docs re: loop_factory (#95979)

This commit is contained in:
Kumar Aditya 2022-08-14 21:23:34 +05:30 committed by GitHub
parent f2afdf3352
commit e8259e047c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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