]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-126137: improve docs for `loop.add_reader` and `loop.add_writer` (GH-128666...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 9 Jan 2025 10:18:23 +0000 (11:18 +0100)
committerGitHub <noreply@github.com>
Thu, 9 Jan 2025 10:18:23 +0000 (10:18 +0000)
gh-126137: improve docs for `loop.add_reader` and `loop.add_writer` (GH-128666)
(cherry picked from commit b2adf556747d080f04b53ba4063b627c2dbe41d1)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Doc/library/asyncio-eventloop.rst

index 8d26346c63018b81a5f1c7db593ae13ed350e179..c0e7911bdedd432471154aa211ebb80096e3e3a9 100644 (file)
@@ -944,6 +944,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
@@ -955,6 +958,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*.