summaryrefslogtreecommitdiff
path: root/Doc/library/asyncio-task.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/asyncio-task.rst')
-rw-r--r--Doc/library/asyncio-task.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
index 21c4e339f5..a07db2930a 100644
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -253,6 +253,11 @@ Future
future is already done when this is called, the callback is scheduled
with :meth:`~BaseEventLoop.call_soon`.
+ :ref:`Use functools.partial to pass parameters to the callback
+ <asyncio-pass-keywords>`. For example,
+ ``fut.add_done_callback(functools.partial(print, "Future:",
+ flush=True))`` will call ``print("Future:", fut, flush=True)``.
+
.. method:: remove_done_callback(fn)
Remove all instances of a callback from the "call when done" list.