Skip to content

Commit 182234f

Browse files
[3.12] gh-126137: improve docs for loop.add_reader and loop.add_writer (GH-128666) (#128668)
gh-126137: improve docs for `loop.add_reader` and `loop.add_writer` (GH-128666) (cherry picked from commit b2adf55) Co-authored-by: Kumar Aditya <[email protected]>
1 parent a784cdf commit 182234f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Doc/library/asyncio-eventloop.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,9 @@ Watching file descriptors
944944
invoke *callback* with the specified arguments once *fd* is available for
945945
reading.
946946

947+
Any preexisting callback registered for *fd* is cancelled and replaced by
948+
*callback*.
949+
947950
.. method:: loop.remove_reader(fd)
948951

949952
Stop monitoring the *fd* file descriptor for read availability. Returns
@@ -955,6 +958,9 @@ Watching file descriptors
955958
invoke *callback* with the specified arguments once *fd* is available for
956959
writing.
957960

961+
Any preexisting callback registered for *fd* is cancelled and replaced by
962+
*callback*.
963+
958964
Use :func:`functools.partial` :ref:`to pass keyword arguments
959965
<asyncio-pass-keywords>` to *callback*.
960966

0 commit comments

Comments
 (0)