Skip to content

gh-136640: Clarify the documentation of the AST module #136868

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy