From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:16:59 +0000 (+0100) Subject: [3.13] gh-126137: improve docs for `loop.add_reader` and `loop.add_writer` (GH-128666... X-Git-Tag: v3.13.2~122 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1d2d62c15ef5fef2e8f914245b935cf85ffbf855;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-126137: improve docs for `loop.add_reader` and `loop.add_writer` (GH-128666) (#128667) gh-126137: improve docs for `loop.add_reader` and `loop.add_writer` (GH-128666) (cherry picked from commit b2adf556747d080f04b53ba4063b627c2dbe41d1) Co-authored-by: Kumar Aditya --- diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 586623b5a78b..8027d3525e59 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -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 ` to *callback*.