Skip to content

gh-150319: Replace all documentation which says "See PEP 585"#150325

Open
sirosen wants to merge 1 commit into
python:mainfrom
sirosen:improve-all-see-pep-585-docstrings
Open

gh-150319: Replace all documentation which says "See PEP 585"#150325
sirosen wants to merge 1 commit into
python:mainfrom
sirosen:improve-all-see-pep-585-docstrings

Conversation

@sirosen
Copy link
Copy Markdown
Contributor

@sirosen sirosen commented May 23, 2026

This is a documentation update touching many modules, eliminating text which says "See PEP 585".
The general phrasing used is "X is generic over Y", and this is kept consistent as much as possible.
We can use different phrasing; the goal here is to be consistent in whatever we choose.

For types visible in the stdlib, documentation is also lifted up into class-level docs.
For builtins, however, the story for documenting this is in many cases more complex.
Therefore, updates to the doc pages are omitted for now.


The following classes in the stdlib get simple updates:

  • array.array
  • asyncio.Future
  • asyncio.Task
  • collections.defaultdict
  • collections.deque
  • contextvars.ContextVar
  • contextvars.Token
  • ctypes.Array
  • os.DirEntry
  • re.Match
  • re.Pattern
  • string.templatelib.Interpolation
  • string.templatelib.Template
  • types.MappingProxyType
  • queue.SimpleQueue
  • weakref.ref

The following classes are documented publicly as functions, and are therefore updated internally (__class_getitem__.__doc__) but not in the public docs:

  • functools.partial
  • itertools.chain

The following builtin types have updates to __class_getitem__.__doc__ but not to any documentation pages:

  • BaseExceptionGroup
  • coroutines (from generators)
  • dict
  • enumerate
  • frozendict
  • frozenset
  • generators (and async generators)
  • list
  • memoryview
  • set
  • slice
  • tuple

Special cases:

  • union objects are now documented as "supporting class-level []", rather than anything to do with generics.

  • Templates might be generic over a single type (union, in theory) or over a TypeVarTuple. As this is not currently fully settled, it is marked with a comment and a mild hint that it is a single type is used
    (namely, "type" is singular rather than "types", plural)


Additional issues resolved:

The following classes in the stdlib get simple updates:

- array.array
- asyncio.Future
- asyncio.Task
- collections.defaultdict
- collections.deque
- contextvars.ContextVar
- contextvars.Token
- ctypes.Array
- os.DirEntry
- re.Match
- re.Pattern
- string.templatelib.Interpolation
- string.templatelib.Template
- types.MappingProxyType
- queue.SimpleQueue
- weakref.ref

The following classes are documented publicly as functions, and are
therefore updated internally (`__class_getitem__.__doc__`) but not in the
public docs:

- functools.partial
- itertools.chain

The following builtin types have updates to `__class_getitem__.__doc__`
but not to any documentation pages:

- BaseExceptionGroup
- coroutines (from generators)
- dict
- enumerate
- frozendict
- frozenset
- generators (and async generators)
- list
- memoryview
- set
- slice
- tuple

Special cases:

- union objects are now documented as "supporting class-level []",
  rather than anything to do with generics.

- Templates might be generic over a single type (union, in theory) or
  over a TypeVarTuple. As this is not currently fully settled, it is
  marked with a comment and a mild hint that it is a single type is used
  (namely, "type" is singular rather than "types", plural)
@read-the-docs-community
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify what memoryview is generic in Links to PEP 585 in Generic types

1 participant