]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-138199: Address potential confusion regarding threading in the `asyncio` HOWTO...
authorAlexander Nordin <alexander.f.nordin@gmail.com>
Mon, 24 Nov 2025 14:08:49 +0000 (06:08 -0800)
committerGitHub <noreply@github.com>
Mon, 24 Nov 2025 14:08:49 +0000 (14:08 +0000)
Doc/howto/a-conceptual-overview-of-asyncio.rst

index 6800a24bc9565d2787212b1e6762de08f057ea53..3adfedbf410ecc89dad8a30e8409ada7af1c6c9a 100644 (file)
@@ -175,9 +175,12 @@ Creating a task automatically schedules it for execution (by adding a
 callback to run it in the event loop's to-do list, that is, collection of jobs).
 The recommended way to create tasks is via :func:`asyncio.create_task`.
 
-Since there's only one event loop (in each thread), :mod:`!asyncio` takes
-care of associating the task with the event loop for you.
-As such, there's no need to specify the event loop.
+:mod:`!asyncio` automatically associates tasks with the event loop for you.
+This automatic association was purposely designed into :mod:`!asyncio` for
+the sake of simplicity.
+Without it, you'd have to keep track of the event loop object and pass it to
+any coroutine function that wants to create tasks, adding redundant clutter
+to your code.
 
 ::