Skip to content

fix: handle bare list in construct_type#1722

Open
nightcityblade wants to merge 1 commit into
anthropics:mainfrom
nightcityblade:fix/issue-1626
Open

fix: handle bare list in construct_type#1722
nightcityblade wants to merge 1 commit into
anthropics:mainfrom
nightcityblade:fix/issue-1626

Conversation

@nightcityblade

Copy link
Copy Markdown

Fixes #1626

Treat bare list annotations as an untyped list in construct_type() instead of indexing missing type arguments. Adds a focused regression test for construct_type(value=[...], type_=list).

Validation:

  • uv run pytest tests/test_models.py -k bare_list
  • uv run ruff check src/anthropic/_models.py tests/test_models.py

@nightcityblade nightcityblade requested a review from a team as a code owner June 30, 2026 15:14
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