gh-136640: Clarify the documentation of the AST module#136868
Closed
mlnrt wants to merge 2 commits intopython:mainfrom
mlnrt:fix-issue-136640
Closed
gh-136640: Clarify the documentation of the AST module#136868mlnrt wants to merge 2 commits intopython:mainfrom mlnrt:fix-issue-136640
mlnrt wants to merge 2 commits intopython:mainfrom
mlnrt:fix-issue-136640
Conversation
AA-Turner
approved these changes
Jul 20, 2025
Member
AA-Turner
left a comment
There was a problem hiding this comment.
Looks good, thanks @mlnrt for working on this during the EuroPython sprints! I'll wait for an AST expert to review before merging. cc: @JelleZijlstra @Eclips4
A
| :attr:`end_col_offset` attributes. The :attr:`lineno` and :attr:`end_lineno` | ||
| are the first and last line numbers of source text span (1-indexed so the | ||
| first line is line 1) and the :attr:`col_offset` and :attr:`end_col_offset` | ||
| Most classes part of the AST module have the :attr:`lineno`, :attr:`col_offset`, |
Member
There was a problem hiding this comment.
Suggested change
| Most classes part of the AST module have the :attr:`lineno`, :attr:`col_offset`, | |
| Most classes in the :mod:`!ast` module have the :attr:`lineno`, :attr:`col_offset`, |
| are the first and last line numbers of source text span (1-indexed so the | ||
| first line is line 1) and the :attr:`col_offset` and :attr:`end_col_offset` | ||
| Most classes part of the AST module have the :attr:`lineno`, :attr:`col_offset`, | ||
| :attr:`end_lineno`, and :attr:`end_col_offset` attributes, including subclasses of |
Member
There was a problem hiding this comment.
Suggested change
| :attr:`end_lineno`, and :attr:`end_col_offset` attributes, including subclasses of | |
| :attr:`end_lineno`, and :attr:`end_col_offset` attributes, including all subclasses of |
Member
|
@mlnrt did you intend to close this? A |
Contributor
Author
|
@AA-Turner no. I just deleted my fork of cpython. I did not realized it would close this |
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.
This PR clarifies the documentation describing the attributes of classes part of the AST module
ast.ASTlocation attributes #136640📚 Documentation preview 📚: https://cpython-previews--136868.org.readthedocs.build/