Skip to content

socket.getaddrinfo Py3.10 docs say "AddressFamily.SOCK_STREAM" #98026

Description

@meredithdutton

Documentation

The socket.getaddrinfo example in the Py3.10 docs is given as the following:

>>> socket.getaddrinfo("example.org", 80, proto=socket.IPPROTO_TCP)
[(<AddressFamily.AF_INET6: 10>, <AddressFamily.SOCK_STREAM: 1>,
 6, '', ('2606:2800:220:1:248:1893:25c8:1946', 80, 0, 0)),
 (<AddressFamily.AF_INET: 2>, <AddressFamily.SOCK_STREAM: 1>,
 6, '', ('93.184.216.34', 80))]

This should have SocketKind instead of the second AddressFamily:

>>> socket.getaddrinfo("example.org", 80, proto=socket.IPPROTO_TCP)
[(<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_STREAM: 1>,
 6, '', ('2606:2800:220:1:248:1893:25c8:1946', 80, 0, 0)),
 (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>,
 6, '', ('93.184.216.34', 80))]

I've checked the main, 3.10 and 3.11 branches, and this is only apparent in the 3.10 documentation. The main and 3.11 branches have older lines here and use the module-level constants. I wouldn't know where to direct a PR, sorry.

Activity

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

    docsDocumentation in the Doc dirtopic-socketRelated to the socket, socketserver and selectors modules

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions