[3.15] gh-150319: Replace all documentation which says "See PEP 585" (GH-150325)#150808
Merged
Merged
Conversation
…ythonGH-150325) * Replace all documentation which says "See PEP 585" 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) * Apply suggestions from code review Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> * Correct several class getitem docs And expand the text for tuples. Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com> * Add notes on generic typing of builtins * Fix typo in tuple.__class_getitem__ docstring * Typo fix: malformed refs Fix `generic` links which weren't marked as `:ref:`. * Strike unnecessary docs on generic-ness Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com> * Apply suggestions from code review These are applied at both the originally indicated locations and in the corresponding docstring definitions. Co-authored-by: Alex Waygood <66076021+AlexWaygood@users.noreply.github.com> * Update Doc/library/re.rst Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> * Update Objects/enumobject.c Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> * Remove tuple generic doc in 'stdtypes' page This is covered in more detail in the cross-linked typing documentation. The other copy of this documentation -- in the docstring for `tuple.__class_getitem__` -- is left in place. * Fix whitespace around new doc of generics Per review, do not introduce or remove whitespace such that section breaks are altered by the introduction of doc on various generic types. In most cases, this is a removal of an extra line. In one case (Arrays), it is the reintroduction of a line. Additionally, two other minor fixes are included: - incorrect indent on 'defaultdicts' - make `mappingproxy.__class_getitem__.__doc__` consistent with other mapping type generic docs Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> * Move placement of memoryview generic note Previous placement was at the end of the main docstring, which is consistent with other types but places it after a section on various methods (which makes it read somewhat inconsistently). Moving it up helps resolve. Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> * Ensure sphinxdoc does not start sentences lowercase Lowercase class names at the start of sentences are marked out with the `class` role. In the case of `deque`, documentation already refers to these as `Deques`, so this form is preferred. * Apply suggestions from code review Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> * Fix line endings and wrap more tightly Line endings fixed by pre-commit ; also re-wrapped the MappingProxyType text which was too long. * Use 'ContextVars' style in sphinx doc --------- (cherry picked from commit 50fe49c879af352914da3baa40c7fd1fb170028c) Co-authored-by: Stephen Rosen <sirosen@globus.org> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com> Co-authored-by: Alex Waygood <66076021+AlexWaygood@users.noreply.github.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This was referenced Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The following classes in the stdlib get simple updates:
The following classes are documented publicly as functions, and are
therefore updated internally (
__class_getitem__.__doc__) but not in thepublic docs:
The following builtin types have updates to
__class_getitem__.__doc__but not to any documentation pages:
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)
Co-authored-by: Jelle Zijlstra jelle.zijlstra@gmail.com
And expand the text for tuples.
Co-authored-by: Jelle Zijlstra 906600+JelleZijlstra@users.noreply.github.com
Add notes on generic typing of builtins
Fix typo in tuple.class_getitem docstring
Typo fix: malformed refs
Fix
genericlinks which weren't marked as:ref:.Co-authored-by: Jelle Zijlstra 906600+JelleZijlstra@users.noreply.github.com
These are applied at both the originally indicated locations and in the
corresponding docstring definitions.
Co-authored-by: Alex Waygood 66076021+AlexWaygood@users.noreply.github.com
Co-authored-by: Alex Waygood Alex.Waygood@Gmail.com
Co-authored-by: Alex Waygood Alex.Waygood@Gmail.com
This is covered in more detail in the cross-linked typing documentation.
The other copy of this documentation -- in the docstring for
tuple.__class_getitem__-- is left in place.Per review, do not introduce or remove whitespace such that section
breaks are altered by the introduction of doc on various generic types.
In most cases, this is a removal of an extra line.
In one case (Arrays), it is the reintroduction of a line.
Additionally, two other minor fixes are included:
mappingproxy.__class_getitem__.__doc__consistent with othermapping type generic docs
Co-authored-by: Bénédikt Tran 10796600+picnixz@users.noreply.github.com
Previous placement was at the end of the main docstring, which is
consistent with other types but places it after a section on various
methods (which makes it read somewhat inconsistently). Moving it up
helps resolve.
Co-authored-by: Bénédikt Tran 10796600+picnixz@users.noreply.github.com
Lowercase class names at the start of sentences are marked out with the
classrole. In the case ofdeque, documentation already refers tothese as
Deques, so this form is preferred.Co-authored-by: Bénédikt Tran 10796600+picnixz@users.noreply.github.com
Line endings fixed by pre-commit ; also re-wrapped the MappingProxyType
text which was too long.
(cherry picked from commit 50fe49c)
Co-authored-by: Stephen Rosen sirosen@globus.org
Co-authored-by: Jelle Zijlstra jelle.zijlstra@gmail.com
Co-authored-by: Jelle Zijlstra 906600+JelleZijlstra@users.noreply.github.com
Co-authored-by: Alex Waygood 66076021+AlexWaygood@users.noreply.github.com
Co-authored-by: Alex Waygood Alex.Waygood@Gmail.com
Co-authored-by: Bénédikt Tran 10796600+picnixz@users.noreply.github.com