Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

avoid getting default values from defaultdict #1853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
davidhewitt merged 2 commits into main from dh/defaultdict
Oct 27, 2025
Merged

Conversation

@davidhewitt
Copy link
Contributor

@davidhewitt davidhewitt commented Oct 23, 2025
edited
Loading

Change Summary

This changes the lookup strategy when passing dict subclasses as inputs to models to be equivalent of input.get(field_name, PydanticUndefined), and then assumes the value is not present if PydanticUndefined is returned.

Related issue number

Fixes pydantic/pydantic#12376

Checklist

  • Unit tests for the changes exist
  • Documentation reflects the changes where applicable
  • Pydantic tests pass with this pydantic-core (except for expected changes)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Copy link

codspeed-hq bot commented Oct 23, 2025

CodSpeed Performance Report

Merging #1853 will not alter performance

Comparing dh/defaultdict (11104ea) with main (eed392b)

Summary

✅ 163 untouched

@davidhewitt davidhewitt merged commit f892755 into main Oct 27, 2025
32 checks passed
@davidhewitt davidhewitt deleted the dh/defaultdict branch October 27, 2025 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Viicos Viicos Viicos approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2.12.0: defaultdict values incorrectly used instead of field defaults

AltStyle によって変換されたページ (->オリジナル) /