]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-32114: Updated the documentation for get_event_loop to reflect the policy change...
authorPablo Galindo <Pablogsal@gmail.com>
Sun, 10 Dec 2017 17:34:59 +0000 (17:34 +0000)
committerYury Selivanov <yury@magic.io>
Sun, 10 Dec 2017 17:34:59 +0000 (12:34 -0500)
Doc/library/asyncio-eventloops.rst

index 7970e9039dfd86b8f785d39e20b110603f35dd41..2097260e2190fe2b921473f2c335432eebc82b2b 100644 (file)
@@ -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