gh-126137: improve docs for `loop.add_reader` and `loop.add_writer` (#128666)
https://github.com/python/cpython/commit/b2adf556747d080f04b53ba4063b627c2db... commit: b2adf556747d080f04b53ba4063b627c2dbe41d1 branch: main author: Kumar Aditya <kumaraditya@python.org> committer: kumaraditya303 <kumaraditya@python.org> date: 2025-01-09T15:40:45+05:30 summary: gh-126137: improve docs for `loop.add_reader` and `loop.add_writer` (#128666) files: M Doc/library/asyncio-eventloop.rst diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index bfc0d16f023e5e..072ab206f25e4f 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -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*.
participants (1)
-
kumaraditya303