cpython
cpython copied to clipboard
tweak asyncio.Runner loop_factory docs to emphasize that the default case *does* call `set_event_loop()`
Whatever gives users the best guidance. I searched for code that uses
Runner(loop_factory=...)and there is one case apart fromtest_runners.py: intest_asyncio/test_subprocess.pyit us used asloop_factory=asyncio.new_event_loopspecifically to prevent the watcher to be set (since the test sets its own watcher).
I would emphasize that the default case does call set_event_loop() and implies attaching the watcher (if there is one!) to the loop; it's fine to suggest that loop_factory should be used only if this is undesired.
Originally posted by @gvanrossum in https://github.com/python/cpython/pull/95979#discussion_r946971337