If we create an AST node with invalid position information, the error is reported in the compiler when it validates the line numbers and end line numbers, which is too far away and debugging this can be quite challenging. To improve the debugging experience, ensure that the parser cannot create an AST node with invalid position information.
This broke a project of mine https://github.com/hauntsaninja/pyp that does some AST tricks. Worth adding a news entry (possibly to Python 3.11 What's New as well)?
Activity
gh-93351: Ensure the position information in AST nodes created by the…
pythongh-93351: Ensure the position information in AST nodes created …
gh-93351: Ensure the position information in AST nodes created by the…
hauntsaninja commented on Jul 23, 2022
This broke a project of mine https://github.com/hauntsaninja/pyp that does some AST tricks. Worth adding a news entry (possibly to Python 3.11 What's New as well)?
pablogsal commented on Jul 23, 2022
I will add a news entry for this
[3.11] pythongh-93351: Add news entry and what's new entry for change…
[3.11] gh-93351: Add news entry and what's new entry for changes in g…
gh-93351: Add news entry and what's new entry for changes in gh-93351 (…