From 48944e8541daf25b09ee87c5146682794e1d32f8 Mon Sep 17 00:00:00 2001 From: anordin95 Date: Wed, 27 Aug 2025 10:06:35 -0700 Subject: [PATCH 1/2] Address logical gap. --- Doc/howto/a-conceptual-overview-of-asyncio.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Doc/howto/a-conceptual-overview-of-asyncio.rst b/Doc/howto/a-conceptual-overview-of-asyncio.rst index d68f7cc6921fc9..4a99f902715503 100644 --- a/Doc/howto/a-conceptual-overview-of-asyncio.rst +++ b/Doc/howto/a-conceptual-overview-of-asyncio.rst @@ -176,9 +176,11 @@ The recommended way to create tasks is via :func:`asyncio.create_task`. 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). -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. +Typically there's only one event loop, so that's quite straightforward. +It's uncommon, but some applications use multithreading and :mod:`!asyncio` +together, where there's one event loop per thread, stored in thread-local +storage. :: From 5caa155f58b3c4a38e8730978345a77c48a43bd4 Mon Sep 17 00:00:00 2001 From: anordin95 Date: Wed, 3 Sep 2025 09:20:26 -0700 Subject: [PATCH 2/2] reword --- Doc/howto/a-conceptual-overview-of-asyncio.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Doc/howto/a-conceptual-overview-of-asyncio.rst b/Doc/howto/a-conceptual-overview-of-asyncio.rst index 4a99f902715503..4cb4474ee04f95 100644 --- a/Doc/howto/a-conceptual-overview-of-asyncio.rst +++ b/Doc/howto/a-conceptual-overview-of-asyncio.rst @@ -177,10 +177,11 @@ 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). :mod:`!asyncio` automatically associates tasks with the event loop for you. -Typically there's only one event loop, so that's quite straightforward. -It's uncommon, but some applications use multithreading and :mod:`!asyncio` -together, where there's one event loop per thread, stored in thread-local -storage. +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. ::