diff options
author | Kumar Aditya <kumaraditya@python.org> | 2025-01-09 10:10:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-09 10:10:45 (GMT) |
commit | b2adf556747d080f04b53ba4063b627c2dbe41d1 (patch) | |
tree | 95a55b01b3644c64df862311734ca463425ce63f /Doc/library | |
parent | 1439b81928f1b52c5a0ac7fd81fdd66afd5f72da (diff) | |
download | cpython-b2adf556747d080f04b53ba4063b627c2dbe41d1.zip cpython-b2adf556747d080f04b53ba4063b627c2dbe41d1.tar.gz cpython-b2adf556747d080f04b53ba4063b627c2dbe41d1.tar.bz2 |
gh-126137: improve docs for `loop.add_reader` and `loop.add_writer` (#128666)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/asyncio-eventloop.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index bfc0d16..072ab20 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*. |