Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-85747: "Preface" section of asyncio-eventloop.rst: Switch to active voice and suggest other edits #99784

Merged
merged 3 commits into from
Dec 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
bskinn marked this conversation as resolved.
Show resolved Hide resolved

.. function:: new_event_loop()

Expand Down