python / python/cpython

Improve documentation for the ``copy`` module

Open
#134,559 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Documentation

In the copy module documentation, the function copy.replace() has a .. versionadded:: annotation marking it as new in Python 3.13.

But the related object.__replace__ dunder method — which is documented muuuuuch farther down the page, near the very end — has no such annotation.

IMHO the two are too far apart and separated by too much completely unrelated documentation, for the annotation from copy.replace() to be implicitly applicable to object.__replace__ as well.

Module-level organization of content

To be perfectly honest, I'm not sure it makes sense for copy.replace() to eventually be documented so far from where it's initially introduced. Especially considering how brief that documentation actually is, the separation may do more harm than good.

No other module in the "Data Types" section starts with an "Interface summary:" like the one in the copy documentation. The most similar doc is the enum module's, which has a §Module Contents at the start. But there inline version annotations are skipped to keep the TOC concise, instead they're collected down below the list itself. Relevant annotations are also included in the detailed documentation sections that follow.

The organization of the copy docs is sort of... well, there's much less organization there, than in the documentation for other modules. (Probably attributable to both the age and extremely short length of the copy documentation.)

Linked PRs
  • gh-134672
  • gh-134695
  • gh-134699
  • gh-134700

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 copy module documentation page and compare the copy.replace() and object.replace sections, including their version annotations. Review linked PRs gh-134672, gh-134695, gh-134699, and gh-134700; done requires an agreed documentation organization and consistent Python 3.13 annotation treatment.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.