Skip to content

Inaccurate description of ast.AST location attributes #136640

Description

[The document] (https://docs.python.org/3/library/ast.html#ast.AST.end_col_offset) states:

Instances of ast.expr and ast.stmt subclasses have lineno, col_offset, end_lineno, and end_col_offset attributes.

However, Some other classes which are not subclasses (excepthandler, arg, etc.) also have these attributes.

Linked PRs

Activity

  1. ghost added
    docsDocumentation in the Doc dir
    on Jul 14, 2025
  2. mlnrt commented on Jul 20, 2025

    @mlnrt
    Contributor

    @koyuki7w thank you for the opening the issue. I just submitted a PR to address it.

  3. added 2 commits that reference this issue on Sep 24, 2026
  4. added a commit that references this issue on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions