Skip to content

fix: support bare dict in construct_type - #1756

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

fix: support bare dict in construct_type#1756
nightcityblade wants to merge 1 commit into
anthropics:mainfrom
nightcityblade:fix/issue-1619-v2

Conversation

@nightcityblade

Copy link
Copy Markdown

Fixes #1619

Guard the origin == dict path in construct_type() so bare dict annotations fall back to object items instead of unpacking an empty get_args() tuple.

Local verification:

  • PYTHONPATH=/tmp/anthropic-sdk-python/src python3.9 -m pytest tests/test_models.py -k bare_dict -q -o addopts=

@nightcityblade
nightcityblade requested a review from a team as a code owner July 13, 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() crashes with ValueError when type_ is a bare dict

1 participant