diff options
author | Yury Selivanov <yury@magic.io> | 2018-01-28 19:09:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-28 19:09:40 (GMT) |
commit | bec2372b7e1da5dfdbadaf242aa8e994b164cace (patch) | |
tree | db2005e235a7e6d82bb49a698eb5b91dd69414c5 /Doc/library | |
parent | a4d00012565d716db6e6abe1b8f33eaaa4de416e (diff) | |
download | cpython-bec2372b7e1da5dfdbadaf242aa8e994b164cace.zip cpython-bec2372b7e1da5dfdbadaf242aa8e994b164cace.tar.gz cpython-bec2372b7e1da5dfdbadaf242aa8e994b164cace.tar.bz2 |
bpo-32327: Revert loop.run_in_executor behaviour: return a Future. (#5392)
I've run some tests on 3.7 asyncio and it appears that too many
things assume that run_in_executor returns a Future.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/asyncio-eventloop.rst | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 78ae183..5f915c5 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -782,6 +782,12 @@ Resolve host name This method is a :ref:`coroutine <coroutine>`, similar to :meth:`socket.getnameinfo` function but non-blocking. +.. versionchanged:: 3.7 + Both *getaddrinfo* and *getnameinfo* methods were always documented + to return a coroutine, but prior to Python 3.7 they were, in fact, + returning :class:`asyncio.Future` objects. Starting with Python 3.7 + both methods are coroutines. + Connect pipes ------------- @@ -852,7 +858,7 @@ Call a function in an :class:`~concurrent.futures.Executor` (pool of threads or pool of processes). By default, an event loop uses a thread pool executor (:class:`~concurrent.futures.ThreadPoolExecutor`). -.. coroutinemethod:: AbstractEventLoop.run_in_executor(executor, func, \*args) +.. method:: AbstractEventLoop.run_in_executor(executor, func, \*args) Arrange for a *func* to be called in the specified executor. @@ -862,6 +868,8 @@ pool of processes). By default, an event loop uses a thread pool executor :ref:`Use functools.partial to pass keywords to the *func* <asyncio-pass-keywords>`. + This method returns a :class:`asyncio.Future` object. + .. versionchanged:: 3.5.3 :meth:`BaseEventLoop.run_in_executor` no longer configures the ``max_workers`` of the thread pool executor it creates, instead @@ -869,11 +877,6 @@ pool of processes). By default, an event loop uses a thread pool executor (:class:`~concurrent.futures.ThreadPoolExecutor`) to set the default. - .. versionchanged:: 3.7 - Even though the method was always documented as a coroutine - method, before Python 3.7 it returned a :class:`Future`. - Since Python 3.7, this is an ``async def`` method. - .. method:: AbstractEventLoop.set_default_executor(executor) Set the default executor used by :meth:`run_in_executor`. |