From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 9 Jul 2024 09:42:45 +0000 (+0200) Subject: [3.13] gh-121333: Clarify what is the default executor for asyncio.run_in_executor... X-Git-Tag: v3.13.0b4~99 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=39f4add7a35cb3367f7d8d3d708c2aefcf0bebed;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-121333: Clarify what is the default executor for asyncio.run_in_executor (GH-121335) (#121526) 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 --- diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 1d79f78e8e1b..70bdd154d6c4 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -1262,6 +1262,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::