From 58774101c4492e00513bf36b9f99841c14a700a2 Mon Sep 17 00:00:00 2001 From: manoj Date: Tue, 14 Apr 2026 19:17:10 +0530 Subject: [PATCH 1/3] Document the loop argument in ensure_future() method --- Doc/library/asyncio-future.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Doc/library/asyncio-future.rst b/Doc/library/asyncio-future.rst index 43977de273e61f..b067235b72adc7 100644 --- a/Doc/library/asyncio-future.rst +++ b/Doc/library/asyncio-future.rst @@ -47,7 +47,10 @@ Future Functions * a :class:`Task` object that would await on *obj*, if *obj* is an awaitable (:func:`inspect.isawaitable` is used for the test.) - If *obj* is neither of the above a :exc:`TypeError` is raised. + If *obj* is neither of the above a :exc:`TypeError` is raised. The + optional *loop* argument takes an object of :class:`EventLoop` to + denote which event loop *obj* belongs to. By default *loop* is set + to currently running event loop. .. important:: From 92eef33316a2d2f64bbc5d2d3e4c2fdfc97a8d43 Mon Sep 17 00:00:00 2001 From: manoj Date: Wed, 15 Apr 2026 10:51:58 +0530 Subject: [PATCH 2/3] Revise and generalize loop parameter documentation --- Doc/library/asyncio-future.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/library/asyncio-future.rst b/Doc/library/asyncio-future.rst index b067235b72adc7..4f76b061dea2bd 100644 --- a/Doc/library/asyncio-future.rst +++ b/Doc/library/asyncio-future.rst @@ -15,6 +15,12 @@ Futures *Future* objects are used to bridge **low-level callback-based code** with high-level async/await code. +.. note:: + + Some of the future functions and the future object use an + optional argument *loop* that takes an object of :class:`EventLoop` + to denote which event loop the future is using. By default *loop* + is set to the event loop that is currently running. Future Functions ================ From a5127b23a2bf28102db4d3cbc8f48c282fa93687 Mon Sep 17 00:00:00 2001 From: manoj Date: Wed, 15 Apr 2026 10:54:20 +0530 Subject: [PATCH 3/3] Revise and generalize loop parameter documentation,Remove old doc --- Doc/library/asyncio-future.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Doc/library/asyncio-future.rst b/Doc/library/asyncio-future.rst index 4f76b061dea2bd..38ece53c4d898d 100644 --- a/Doc/library/asyncio-future.rst +++ b/Doc/library/asyncio-future.rst @@ -53,10 +53,7 @@ Future Functions * a :class:`Task` object that would await on *obj*, if *obj* is an awaitable (:func:`inspect.isawaitable` is used for the test.) - If *obj* is neither of the above a :exc:`TypeError` is raised. The - optional *loop* argument takes an object of :class:`EventLoop` to - denote which event loop *obj* belongs to. By default *loop* is set - to currently running event loop. + If *obj* is neither of the above a :exc:`TypeError` is raised. .. important::