python / python/devguide

Clarify usage of type hints in the standard-library modules

Open
#1,304 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

topic-dev process topic-stdlib type-feature
Dominant language
Python
Stars
2.1k
Forks
1k
Avg merge
2d 12h
Merged PRs (30d)
12

Description

I think that Alex summarized the issue pretty well:

In general our policy is currently not to add type hints to standard-library modules in the Lib/ directory (there are some exceptions, but they're all pretty specific). I think we still have yet to add some formal documentation around this in the devguide (we really need to!), but you can see some rationales here:

Originally posted by @AlexWaygood in https://github.com/python/cpython/pull/117583#discussion_r1556105954

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 linked discussion and pull-request comments for the current policy and its rationale, then locate the appropriate devguide documentation page. Done means the guide formally explains the standard-library type-hint policy, including its rationale and exceptions.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.