]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-126137: improve docs for `loop.add_reader` and `loop.add_writer` (#128666)
authorKumar Aditya <kumaraditya@python.org>
Thu, 9 Jan 2025 10:10:45 +0000 (15:40 +0530)
committerGitHub <noreply@github.com>
Thu, 9 Jan 2025 10:10:45 +0000 (15:40 +0530)
Doc/library/asyncio-eventloop.rst

index bfc0d16f023e5e07c3c17712daa1ea8526bf59a4..072ab206f25e4fac392ed4c6fd4d56a0be3649f7 100644 (file)
@@ -970,6 +970,9 @@ Watching file descriptors
    invoke *callback* with the specified arguments once *fd* is available for
    reading.
 
+   Any preexisting callback registered for *fd* is cancelled and replaced by
+   *callback*.
+
 .. method:: loop.remove_reader(fd)
 
    Stop monitoring the *fd* file descriptor for read availability. Returns
@@ -981,6 +984,9 @@ Watching file descriptors
    invoke *callback* with the specified arguments once *fd* is available for
    writing.
 
+   Any preexisting callback registered for *fd* is cancelled and replaced by
+   *callback*.
+
    Use :func:`functools.partial` :ref:`to pass keyword arguments
    <asyncio-pass-keywords>` to *callback*.