[Python-checkins] cpython (3.4): Issue #24509: Clarify Handle.cancel() and loop.call_* methods.

yury.selivanov python-checkins at python.org
Thu Jun 25 19:50:51 CEST 2015


https://hg.python.org/cpython/rev/3199ec504dbe
changeset:   96675:3199ec504dbe
branch:      3.4
parent:      96672:5f1ce5afd3ee
user:        Yury Selivanov <yselivanov at sprymix.com>
date:        Thu Jun 25 13:49:52 2015 -0400
summary:
  Issue #24509: Clarify Handle.cancel() and loop.call_* methods.

files:
  Doc/library/asyncio-eventloop.rst |  12 +++++++++---
  1 files changed, 9 insertions(+), 3 deletions(-)


diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst
--- a/Doc/library/asyncio-eventloop.rst
+++ b/Doc/library/asyncio-eventloop.rst
@@ -97,7 +97,8 @@
    Any positional arguments after the callback will be passed to the
    callback when it is called.
 
-   An instance of :class:`asyncio.Handle` is returned.
+   An instance of :class:`asyncio.Handle` is returned, which can be
+   used to cancel the callback.
 
    :ref:`Use functools.partial to pass keywords to the callback
    <asyncio-pass-keywords>`.
@@ -130,7 +131,8 @@
    Arrange for the *callback* to be called after the given *delay*
    seconds (either an int or float).
 
-   An instance of :class:`asyncio.Handle` is returned.
+   An instance of :class:`asyncio.Handle` is returned, which can be
+   used to cancel the callback.
 
    *callback* will be called exactly once per call to :meth:`call_later`.
    If two callbacks are scheduled for exactly the same time, it is
@@ -151,6 +153,9 @@
 
    This method's behavior is the same as :meth:`call_later`.
 
+   An instance of :class:`asyncio.Handle` is returned, which can be
+   used to cancel the callback.
+
    :ref:`Use functools.partial to pass keywords to the callback
    <asyncio-pass-keywords>`.
 
@@ -704,7 +709,8 @@
 
    .. method:: cancel()
 
-      Cancel the call.
+      Cancel the call.  If the callback is already canceled or executed,
+      this method has no effect.
 
 
 Event loop examples

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list