Skip to content

Conversation

mlnrt
Copy link
Contributor

@mlnrt mlnrt commented Jul 20, 2025

This PR clarifies the documentation describing the attributes of classes part of the AST module


📚 Documentation preview 📚: https://cpython-previews--136868.org.readthedocs.build/

Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news sprint
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants