summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorBrian Skinn <brian.skinn@gmail.com>2022-12-04 00:48:41 (GMT)
committerGitHub <noreply@github.com>2022-12-04 00:48:41 (GMT)
commitbf26bdf6ac04878fc720e78422991aaedb9808a1 (patch)
tree4f2eb3adaa6dfedbb1a8137ede3ecb6d6f871060 /Doc/library
parenta87c46eab3c306b1c5b8a072b7b30ac2c50651c0 (diff)
downloadcpython-bf26bdf6ac04878fc720e78422991aaedb9808a1.zip
cpython-bf26bdf6ac04878fc720e78422991aaedb9808a1.tar.gz
cpython-bf26bdf6ac04878fc720e78422991aaedb9808a1.tar.bz2
gh-85747: "Preface" section of asyncio-eventloop.rst: Switch to active voice and suggest other edits (#99784)
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/asyncio-eventloop.rst17
1 files changed, 10 insertions, 7 deletions
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst
index d0a1ed2..0bcaed5 100644
--- a/Doc/library/asyncio-eventloop.rst
+++ b/Doc/library/asyncio-eventloop.rst
@@ -33,7 +33,8 @@ an event loop:
Return the running event loop in the current OS thread.
- If there is no running event loop a :exc:`RuntimeError` is raised.
+ Raise a :exc:`RuntimeError` if there is no running event loop.
+
This function can only be called from a coroutine or a callback.
.. versionadded:: 3.7
@@ -52,17 +53,19 @@ an event loop:
:func:`get_running_loop` function is preferred to :func:`get_event_loop`
in coroutines and callbacks.
- Consider also using the :func:`asyncio.run` function instead of using
- lower level functions to manually create and close an event loop.
+ As noted above, consider using the higher-level :func:`asyncio.run` function,
+ instead of using these lower level functions to manually create and close an
+ event loop.
.. deprecated:: 3.10
- Deprecation warning is emitted if there is no running event loop.
- In future Python releases, this function will be an alias of
- :func:`get_running_loop`.
+ Emits a deprecation warning if there is no running event loop.
+ In future Python releases, this function may become an alias of
+ :func:`get_running_loop` and will accordingly raise a
+ :exc:`RuntimeError` if there is no running event loop.
.. function:: set_event_loop(loop)
- Set *loop* as a current event loop for the current OS thread.
+ Set *loop* as the current event loop for the current OS thread.
.. function:: new_event_loop()