[Python-checkins] bpo-31960: Fix asyncio.Future documentation for thread (un)safety. (GH-4319) (#4320)

Antoine Pitrou webhook-mailer at python.org
Tue Nov 7 11:22:22 EST 2017


https://github.com/python/cpython/commit/518c6b97868d9c665475a40567b0aa417afad607
commit: 518c6b97868d9c665475a40567b0aa417afad607
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Antoine Pitrou <pitrou at free.fr>
date: 2017-11-07T17:22:18+01:00
summary:

bpo-31960: Fix asyncio.Future documentation for thread (un)safety. (GH-4319) (#4320)

(cherry picked from commit 22b1128559bdeb96907da5840960691bb050d11a)

files:
M Doc/library/asyncio-task.rst
M Lib/asyncio/futures.py

diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
index 5298c11058c..cc8fffb0659 100644
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -216,7 +216,7 @@ Future
      raise an exception when the future isn't done yet.
 
    - Callbacks registered with :meth:`add_done_callback` are always called
-     via the event loop's :meth:`~AbstractEventLoop.call_soon_threadsafe`.
+     via the event loop's :meth:`~AbstractEventLoop.call_soon`.
 
    - This class is not compatible with the :func:`~concurrent.futures.wait` and
      :func:`~concurrent.futures.as_completed` functions in the
diff --git a/Lib/asyncio/futures.py b/Lib/asyncio/futures.py
index cff9590e4ea..511a14b97bc 100644
--- a/Lib/asyncio/futures.py
+++ b/Lib/asyncio/futures.py
@@ -112,11 +112,13 @@ class Future:
 
     Differences:
 
+    - This class is not thread-safe.
+
     - result() and exception() do not take a timeout argument and
       raise an exception when the future isn't done yet.
 
     - Callbacks registered with add_done_callback() are always called
-      via the event loop's call_soon_threadsafe().
+      via the event loop's call_soon().
 
     - This class is not compatible with the wait() and as_completed()
       methods in the concurrent.futures package.



More information about the Python-checkins mailing list