[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 b2adf55674)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
Miss Islington (bot) 2025-01-09 11:16:59 +01:00 committed by GitHub
parent 4f01a120f7
commit 1d2d62c15e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View 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*.