Skip to content

fix: handle bare unparameterized list in construct_type - #1754

Open
gautamkishore wants to merge 1 commit into
anthropics:mainfrom
gautamkishore:fix/1626-construct-type-bare-list
Open

fix: handle bare unparameterized list in construct_type#1754
gautamkishore wants to merge 1 commit into
anthropics:mainfrom
gautamkishore:fix/1626-construct-type-bare-list

Conversation

@gautamkishore

Copy link
Copy Markdown

Fixes #1626

When construct_type is called with a bare list (no type parameter, e.g. construct_type(value=[...], type_=list)), get_args(list) returns an empty tuple, causing IndexError at args[0].

This PR adds a guard to return the value unchanged when there are no type arguments.

@gautamkishore
gautamkishore requested a review from a team as a code owner July 13, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: construct_type() raises IndexError when called with bare unparameterized list

1 participant