diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2020-01-20 22:46:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-20 22:46:38 (GMT) |
commit | 2c49becc69c05934996a00b902e4a4f089b91954 (patch) | |
tree | e876ce377722ee930fb83847709079288f71e0f1 /Doc/library | |
parent | 1e420f849d0c094098543d2c27d35eaec69b2784 (diff) | |
download | cpython-2c49becc69c05934996a00b902e4a4f089b91954.zip cpython-2c49becc69c05934996a00b902e4a4f089b91954.tar.gz cpython-2c49becc69c05934996a00b902e4a4f089b91954.tar.bz2 |
Fix asyncio.get_event_loop() documentation (GH-18051)
Mention that the function implicitly creates new event loop only if called from the main thread.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/asyncio-eventloop.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index ee995e0..25a3692 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -38,8 +38,10 @@ an event loop: .. function:: get_event_loop() - Get the current event loop. If there is no current event loop set - in the current OS thread and :func:`set_event_loop` has not yet + Get the current event loop. + + If there is no current event loop set in the current OS thread, + the OS thread is main, and :func:`set_event_loop` has not yet been called, asyncio will create a new event loop and set it as the current one. |