summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2017-12-10 17:34:59 (GMT)
committerYury Selivanov <yury@magic.io>2017-12-10 17:34:59 (GMT)
commit77106b2c21e59d0466742cc3afa50f9e8345e186 (patch)
treea9edee1ea9901c5599dc544aca33c4ddb2125f72 /Doc/library
parentf658641a05651e0eb717bb40e2c85dca3470369d (diff)
downloadcpython-77106b2c21e59d0466742cc3afa50f9e8345e186.zip
cpython-77106b2c21e59d0466742cc3afa50f9e8345e186.tar.gz
cpython-77106b2c21e59d0466742cc3afa50f9e8345e186.tar.bz2
bpo-32114: Updated the documentation for get_event_loop to reflect the policy change (#4510)
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/asyncio-eventloops.rst13
1 files changed, 9 insertions, 4 deletions
diff --git a/Doc/library/asyncio-eventloops.rst b/Doc/library/asyncio-eventloops.rst
index 7970e90..2097260 100644
--- a/Doc/library/asyncio-eventloops.rst
+++ b/Doc/library/asyncio-eventloops.rst
@@ -189,10 +189,15 @@ An event loop policy must implement the following interface:
The default policy defines context as the current thread, and manages an event
-loop per thread that interacts with :mod:`asyncio`. If the current thread
-doesn't already have an event loop associated with it, the default policy's
-:meth:`~AbstractEventLoopPolicy.get_event_loop` method creates one when
-called from the main thread, but raises :exc:`RuntimeError` otherwise.
+loop per thread that interacts with :mod:`asyncio`. An exception to this rule
+happens when :meth:`~AbstractEventLoopPolicy.get_event_loop` is called from a
+running future/coroutine, in which case it will return the current loop
+running that future/coroutine.
+
+If the current thread doesn't already have an event loop associated with it,
+the default policy's :meth:`~AbstractEventLoopPolicy.get_event_loop` method
+creates one when called from the main thread, but raises :exc:`RuntimeError`
+otherwise.
Access to the global loop policy