python / python/cpython

Link from typing docs to specific sections in the typing spec

Open
#117,539 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The typing docs currently frequently link to the PEPs that defined new typing features. Instead, they should link to the typing spec, which unlike the PEPs is a living document.

In the online documentation, we can do this with intersphinx. I have this running locally and can send a PR.

I'm less sure about how to handle this in the docstrings. For example, Protocol's docstring refers to PEP 544: https://github.com/python/cpython/blob/b32789ccb91bbe43e88193f68b1364a8da6d9866/Lib/typing.py#L1987. Should we provide a full URL to the spec, like https://typing.readthedocs.io/en/latest/spec/protocol.html?

Linked PRs
  • gh-117540

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 by reviewing the typing documentation links and the intersphinx setup, then inspect the Protocol docstring in Lib/typing.py around the referenced PEP 544 link. Decide how both online documentation and docstrings should point to the living typing spec, and verify that the relevant links use the intended spec sections.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.