summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorElvis Pranskevichus <elvis@magic.io>2018-07-30 10:42:43 (GMT)
committerVictor Stinner <vstinner@redhat.com>2018-07-30 10:42:43 (GMT)
commit22d25085db2590932b3664ca32ab82c08f2eb2db (patch)
treed173242dc2c035baf83bf36eb26d992618c1e796 /Doc
parent4e11c461ed39085b8495a35c9367b46d8a0d306d (diff)
downloadcpython-22d25085db2590932b3664ca32ab82c08f2eb2db.zip
cpython-22d25085db2590932b3664ca32ab82c08f2eb2db.tar.gz
cpython-22d25085db2590932b3664ca32ab82c08f2eb2db.tar.bz2
bpo-34075: Deprecate non-ThreadPoolExecutor in loop.set_default_executor() (GH-8533)
Various asyncio internals expect that the default executor is a `ThreadPoolExecutor`, so deprecate passing anything else to `loop.set_default_executor()`.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/asyncio-eventloop.rst9
-rw-r--r--Doc/whatsnew/3.8.rst6
2 files changed, 14 insertions, 1 deletions
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst
index 317f3fb..cf7b6d8 100644
--- a/Doc/library/asyncio-eventloop.rst
+++ b/Doc/library/asyncio-eventloop.rst
@@ -906,7 +906,14 @@ pool of processes). By default, an event loop uses a thread pool executor
.. method:: AbstractEventLoop.set_default_executor(executor)
- Set the default executor used by :meth:`run_in_executor`.
+ Set *executor* as the default executor used by :meth:`run_in_executor`.
+ *executor* should be an instance of
+ :class:`~concurrent.futures.ThreadPoolExecutor`.
+
+ .. deprecated:: 3.8
+ Using an executor that is not an instance of
+ :class:`~concurrent.futures.ThreadPoolExecutor` is deprecated and
+ will trigger an error in Python 3.9.
Error Handling API
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index 3f51535..bab1e06 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -164,6 +164,12 @@ Deprecated
They will be removed in Python 3.9.
(Contributed by Serhiy Storchaka in :issue:`29209`.)
+* Passing an object that is not an instance of
+ :class:`concurrent.futures.ThreadPoolExecutor` to
+ :meth:`asyncio.AbstractEventLoop.set_default_executor()` is
+ deprecated and will be prohibited in Python 3.9.
+ (Contributed by Elvis Pranskevichus in :issue:`34075`.)
+
Removed
=======