bpo-30935: update get_event_loop docs (GH-2731)

(cherry picked from commit e55de2d77f)

Co-authored-by: Mandeep Singh <daxlab@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2018-05-29 12:33:29 -07:00 committed by GitHub
parent 6aacc160a8
commit 51bf38f796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -169,12 +169,15 @@ An event loop policy must implement the following interface:
Get the event loop for the current context.
Returns an event loop object implementing the :class:`AbstractEventLoop`
interface.
interface. In case called from coroutine, it returns the currently
running event loop.
Raises an exception in case no event loop has been set for the current
context and the current policy does not specify to create one. It must
never return ``None``.
.. versionchanged:: 3.6
.. method:: set_event_loop(loop)
Set the event loop for the current context to *loop*.

View File

@ -818,7 +818,7 @@ Notable changes in the :mod:`asyncio` module since Python 3.5.0
(all backported to 3.5.x due to the provisional status):
* The :func:`~asyncio.get_event_loop` function has been changed to
always return the currently running loop when called from couroutines
always return the currently running loop when called from coroutines
and callbacks.
(Contributed by Yury Selivanov in :issue:`28613`.)