Skip to content

ast: Add missing APIs for Python 3.14 and 3.15 syntax#15930

Merged
AlexWaygood merged 1 commit into
python:mainfrom
AlexWaygood:alex/update-ast-for-new-syntax
Jun 22, 2026
Merged

ast: Add missing APIs for Python 3.14 and 3.15 syntax#15930
AlexWaygood merged 1 commit into
python:mainfrom
AlexWaygood:alex/update-ast-for-new-syntax

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Jun 22, 2026

Copy link
Copy Markdown
Member

Closes #15929.

Python 3.14 added the TemplateStr and Interpolation AST nodes, but the corresponding dynamically dispatched methods were missing from NodeVisitor.

Python 3.15 also permits dictionary unpacking in comprehensions, which represents the DictComp.value field as None. This PR therefore also updates the version-gated constructor and __replace__ signatures to accept that representation.

For example:

merged = {**mapping for mapping in mappings}

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood

Copy link
Copy Markdown
Member Author

the regr_test.py CI failure seems unrelated...

@AlexWaygood AlexWaygood marked this pull request as ready for review June 22, 2026 10:21
@AlexWaygood AlexWaygood merged commit c9e422d into python:main Jun 22, 2026
57 of 58 checks passed
@AlexWaygood AlexWaygood deleted the alex/update-ast-for-new-syntax branch June 22, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing definitions for visit_TemplateStr and visit_Interpolation in ast module

2 participants