[Python-checkins] bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method not a coroutine (GH-21852)

Miss Islington (bot) webhook-mailer at python.org
Mon Aug 17 10:37:32 EDT 2020


https://github.com/python/cpython/commit/1baa8b14ee23ef3040923f53565c8d1bafd28117
commit: 1baa8b14ee23ef3040923f53565c8d1bafd28117
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-08-17T07:37:12-07:00
summary:

bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method not a coroutine (GH-21852)


asyncio.AbstractEventLoop.run_in_executor should be a method that returns an asyncio Future, not an async method.
This matches the concrete implementations, and the documentation better.
(cherry picked from commit 29f84294d88ec493c2de9d6e8dbc12fae3778771)

Co-authored-by: James Weaver <james.barrett at bbc.co.uk>

files:
A Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst
M Lib/asyncio/events.py

diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py
index ca08663a5b358..353a9f5af0c49 100644
--- a/Lib/asyncio/events.py
+++ b/Lib/asyncio/events.py
@@ -280,7 +280,7 @@ def create_task(self, coro, *, name=None):
     def call_soon_threadsafe(self, callback, *args):
         raise NotImplementedError
 
-    async def run_in_executor(self, executor, func, *args):
+    def run_in_executor(self, executor, func, *args):
         raise NotImplementedError
 
     def set_default_executor(self, executor):
diff --git a/Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst b/Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst
new file mode 100644
index 0000000000000..d4c7e0e2419df
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst
@@ -0,0 +1 @@
+Change the method asyncio.AbstractEventLoop.run_in_executor to not be a coroutine.
\ No newline at end of file



More information about the Python-checkins mailing list