Closed
Description
We should document PEP-695 for Python 3.12 (issue #103763, PR #103764 for implementation). I am leaving docs out of the PR to avoid complicating an already huge PR with a tight deadline, but let's start thinking about what we need to document:
- New AST nodes in
ast.rst
- Language reference should be updated to include the new grammar changes
- Language reference should be updated to reflect new scoping rules (https://docs.python.org/3.12/reference/executionmodel.html#naming-and-binding)
-
typing.rst
should list the PEP -
typing.rst
should mention thatTypeVar
gained aninfer_variance
argument and that it now supports lazily evaluated bounds/constraints - Examples of generics in
typing.rst
should use the new syntax -
typing.rst
should document the newTypeAliasType
-
typing.TypeAlias
should be mentioned as deprecated (including in the deprecation timeline at the bottom oftyping.rst
), and any examples of type aliases should be updated to use the new syntax - New opcodes need to be mentioned in
dis.rst
.dis.dis
docs should mention new contexts where nested code objects can appear. TheCALL_INTRINSIC_1
and 2 opcodes should mention the new intrinsics.
Linked PRs
- gh-103921: Document PEP 695 #104642
- gh-103921: Rename "type" header in argparse docs #104654
- [3.12] gh-103921: Document PEP 695 (GH-104642) #104989
- [3.11] gh-103921: Improve typing documentation (GH-104642) #105007
- gh-103921: Minor PEP-695 fixes to the
ast
module docs #105093 - [3.12] gh-103921: Minor PEP-695 fixes to the
ast
module docs (GH-105093) #105101