8000 Properly support type variable defaults by Viicos · Pull Request #11332 · pydantic/pydantic · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@Viicos
Copy link
Member
@Viicos Viicos commented Jan 23, 2025

If a type argument isn't provided, use the default value.

Change Summary

Fixes #11270, closes #11297.

Related issue number

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@cloudflare-workers-and-pages
Copy link
cloudflare-workers-and-pages bot commented Jan 23, 2025

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: ec82c47
Status: ✅  Deploy successful!
Preview URL: https://a902f4a8.pydantic-docs.pages.dev
Branch Preview URL: https://typevar-defaults.pydantic-docs.pages.dev

View logs

If a type argument isn't provided, use the default value.
@codspeed-hq
Copy link
codspeed-hq bot commented Jan 23, 2025

CodSpeed Performance Report

Merging #11332 will not alter performance

Comparing typevar-defaults (ec82c47) with main (221275f)

Summary

✅ 45 untouched benchmarks

@github-actions
Copy link
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pydantic
  main.py
  pydantic/_internal
  _generics.py
Project Total  

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

Copy link
Contributor
@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

Generally, looking good! Thanks for tackling this :)

Copy link
Contributor
@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

Thanks, it's more clear with the extra comment.

@Viicos Viicos merged commit be3b3c0 into main Jan 24, 2025
56 checks passed
@Viicos Viicos deleted the typevar-defaults branch January 24, 2025 14:55
@Viicos Viicos added relnotes-feature and removed relnotes-fix Used for bugfixes. labels Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generic type defaults (pep-696) throws an exception when used in type annotations.

3 participants

0