Skip to content

AST nodes for PEP 695 type param syntax do not require end_lineno nor end_col_offset #106145

Description

@jacobtylerwalls

Bug report

Unlike AST nodes for 3.10 match syntax, AST nodes for 3.12 type param syntax (PEP 695) do not require end_lineno nor end_col_offset.

For 3.10 match syntax, this question was discussed here, and it was decided to require them.

Context: see end_lineno and end_col_offset creation in 3.8 by #11605.

cpython/Parser/Python.asdl

Lines 148 to 151 in bb578a0

type_param = TypeVar(identifier name, expr? bound)
| ParamSpec(identifier name)
| TypeVarTuple(identifier name)
attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)

Your environment

Python 3.12.0b3

Linked PRs

Activity

  1. Eclips4 commented on Jun 27, 2023

    @Eclips4
    Member
  2. JelleZijlstra commented on Jun 27, 2023

    @JelleZijlstra
    Member

    Good catch, I think we should fix this. Feel free to submit a PR; otherwise I should get to it in the next few days.

  3. added a commit that references this issue on Jun 29, 2023
  4. sobolevn commented on Jun 29, 2023

    @sobolevn
    Member

    Sorry for sliding in, but I was experimenting with type_params support for my linter and found this related issue :)

  5. added a commit that references this issue on Jun 30, 2023
  6. added a commit that references this issue on Jun 30, 2023
  7. added a commit that references this issue on Jul 1, 2023
  8. jacobtylerwalls commented on Jul 1, 2023

    @jacobtylerwalls
    ContributorAuthor

    Fixed in #106224. Thanks all!

  9. added a commit that references this issue on Jul 1, 2023
  10. added a commit that references this issue on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions