From f24f31656c320e6cefa093a2230620f6061dd806 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:36:40 +0200 Subject: [PATCH] [3.12] gh-121333: Clarify what is the default executor for asyncio.run_in_executor (GH-121335) (#121525) gh-121333: Clarify what is the default executor for asyncio.run_in_executor (GH-121335) (cherry picked from commit facf9862da0cf9331550747197800d682cd371fb) Co-authored-by: AN Long Co-authored-by: Kumar Aditya --- Doc/library/asyncio-eventloop.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 6081a052e6e..2b6f7df1071 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -1246,6 +1246,9 @@ Executing code in thread or process pools The *executor* argument should be an :class:`concurrent.futures.Executor` instance. The default executor is used if *executor* is ``None``. + The default executor can be set by :meth:`loop.set_default_executor`, + otherwise, a :class:`concurrent.futures.ThreadPoolExecutor` will be + lazy-initialized and used by :func:`run_in_executor` if needed. Example::