Skip to content

Allow default factories of private attributes to take validated model data - #13013

Merged
Viicos merged 2 commits into
mainfrom
vp/default-factory-validated-data
Apr 2, 2026
Merged

Viicos merged 2 commits into
mainfrom
vp/default-factory-validated-data

Conversation

@Viicos

@Viicos Viicos commented Apr 1, 2026

Copy link
Copy Markdown
Member

Wrap up of #11685.

@Viicos Viicos added relnotes-feature needs-blogpost-entry This PR needs to be documented in the release notes blog post labels Apr 1, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Apr 1, 2026 •

Copy link
Copy Markdown

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: a0312e7
Status: ✅  Deploy successful!
Preview URL: https://2e0595c6.pydantic-docs.pages.dev
Branch Preview URL: https://vp-default-factory-validated.pydantic-docs.pages.dev

View logs

@codspeed

codspeed Bot commented Apr 1, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 30.07%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 211 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ test_simple_recursive_model_schema_generation 808 µs 621.2 µs +30.07%

Comparing vp/default-factory-validated-data (a0312e7) with main (07c180b)

Open in CodSpeed

@friendlymatthew friendlymatthew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐄

@Viicos
Viicos force-pushed the vp/default-factory-validated-data branch from f82c549 to e7107a8 Compare April 1, 2026 14:06
@Viicos
Viicos force-pushed the vp/default-factory-validated-data branch from e7107a8 to a0312e7 Compare April 1, 2026 14:22
@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pydantic
  fields.py
  pydantic/_internal
  _fields.py
  _model_construction.py
  _utils.py
Project Total  

This report was generated by python-coverage-comment-action

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

Labels

needs-blogpost-entry This PR needs to be documented in the release notes blog post relnotes-feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants