Repository navigation
Replace ast.dump in error messages - #889
Merged
Merged
Conversation
The output of ``ast.dump`` changes between Python versions (*e.g.*, Python 3.13 omits ``ctx=Load()``), which broke the recorded error messages when we moved from Python 3.12 to 3.14. We introduce ``ast_dump.dump`` which renders only the top level of a node as source code, and describes its children briefly, *e.g.*, ``f(<call to self.g>, *z, w=1)`` or ``<|-operator> | None``. We keep ``ast.dump`` for the in-process structural comparisons in the parse rules, as nothing is recorded there.
mristin
force-pushed
the
mristin/Replace-ast.dump
branch
from
November 14, 2026 22:25
acf7cc5 to
337c256
Compare
Contributor
Author
|
@empwilli FYI |
Coverage Report for CI Build 43648031260Coverage decreased (-0.06%) to 90.289%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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 output of
ast.dumpchanges between Python versions (e.g., Python 3.13 omitsctx=Load()), which broke the recorded error messages when we moved from Python 3.12 to 3.14.We introduce
ast_dump.dumpwhich renders only the top level of a node as source code, and describes its children briefly, e.g.,f(<call to self.g>, *z, w=1)or<|-operator> | None. We keepast.dumpfor the in-process structural comparisons in the parse rules, as nothing is recorded there.