Skip to content

asyncio: incorrect docstring for loop.sock_sendto (copied from sock_sendall) #150952

Closed

Description

@deadlovelll

Bug description:

BaseSelectorEventLoop.sock_sendto() in Lib/asyncio/selector_events.py has a docstring that just a copy-paste of BaseSelectorEventLoop.sock_sendall() docstring.

The reference documentation already describes it correctly: loop.sock_sendto()

Current docstring:

"""Send data to the socket.

The socket must be connected to a remote socket. This method continues
to send data from data until either all data has been sent or an
error occurs. None is returned on success. On error, an exception is
raised, and there is no way to determine how much data, if any, was
successfully processed by the receiving end of the connection.
"""

Proposed fix: replace the docstring with correct datagram description:

"""Send a datagram from sock to address.

The socket does not have to be connected. This method sends the
whole datagram in a single call. Return the number of bytes sent.
"""

CPython versions tested on:

3.16, CPython main branch

Operating systems tested on:

macOS

Linked PRs

Activity

  1. added
    type-bug
    on Jun 5, 2026
  2. deadlovelll commented on Jun 5, 2026

    @deadlovelll
    ContributorAuthor

    I'll create the pr

  3. added
    docs
    stdlib
    on Jun 5, 2026
  4. added a commit that references this issue on Jul 15, 2026
  5. moved this from Todo to Done in asyncioon Jul 15, 2026
  6. added 3 commits that reference this issue on Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsstdlibtopic-asynciotype-bug

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions