Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new source location fields in Python 3.8+ #32

Open
Technologicat opened this issue Jan 27, 2022 · 2 comments
Open

Support new source location fields in Python 3.8+ #32

Technologicat opened this issue Jan 27, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Technologicat
Copy link
Owner

Python 3.8 added the end_lineno and end_col_offset fields to AST nodes that have lineno and col_offset.

Specs in the official documentation.

We should probably worry about these anywhere we handle source location info.

@Technologicat Technologicat added the enhancement New feature or request label Jan 27, 2022
@Technologicat Technologicat self-assigned this Jan 27, 2022
@Technologicat
Copy link
Owner Author

Same in unpythonic; tracked in Technologicat/unpythonic#83

@Technologicat
Copy link
Owner Author

As of v3.6.2, we fill in the end_lineno and end_col_offset info in the global postprocess pass (copying it from reference nodes), but that's literally the only thing we do with this information at this point.

This was needed to get Python 3.11+ support working, because as of Python 3.11, the compiler now includes an AST validator (which is a good thing!) that requires e.g. that end_lineno >= lineno.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant