Skip to content

Python: Parse class bases like function arguments - #22301

Open
maxfischer2781 wants to merge 2 commits into
github:mainfrom
maxfischer2781:python/class-base-as-args
Open

Python: Parse class bases like function arguments#22301
maxfischer2781 wants to merge 2 commits into
github:mainfrom
maxfischer2781:python/class-base-as-args

Conversation

@maxfischer2781

Copy link
Copy Markdown

This PR adjusts how class bases are parsed to match the parsing of function arguments.

Previously, any node with a value field was excluded to reject dict-splats as bases; this would also reject many other valid nodes, critically subscripts as used for typing (e.g. list[int]). Now, the undesired node types are explicitly rejected.

Closes #22298.

@github-actions github-actions Bot added the Python label Aug 7, 2026
@maxfischer2781
maxfischer2781 marked this pull request as ready for review August 7, 2026 17:16
@maxfischer2781
maxfischer2781 requested review from a team as code owners August 7, 2026 17:16
@bettykadondi12

Copy link
Copy Markdown

Good

@hvitved

hvitved commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Hi. Thanks for your contribution; could you perhaps add some test cases as well?

@maxfischer2781

Copy link
Copy Markdown
Author

Hi. Thanks for your contribution; could you perhaps add some test cases as well?

I can try. It's not really clear to me how the parser tests work. Do I see it correctly that in python/extractor/tests/parser/ I need to add a Python <test name>_new.py alongisde its parser output in <test name>_new.expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python] tsg-parser fails to extract generic base class relations

3 participants