]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] 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:16:59 +0000 (11:16 +0100)
committerGitHub <noreply@github.com>
Thu, 9 Jan 2025 10:16:59 +0000 (10:16 +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 586623b5a78bb3e2a7d5ba411a898902a5404185..8027d3525e59995eb8b57b7c3cd616f26ea5c366 100644 (file)
@@ -960,6 +960,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
@@ -971,6 +974,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*.