python / python/cpython

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

Open Beginner friendly
#98,026 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs topic-socket
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Py3.10 version of Doc/library/socket.rst and inspect the socket.getaddrinfo example linked in the issue. Compare it with the main and 3.11 documentation, update the displayed enum type if needed, and verify that the example matches the documented output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.