Skip to content

Conversation

jinnovation
Copy link
Contributor

@jinnovation jinnovation commented May 2, 2025

Change Summary

There is a disclaimer at top of file that mentions using typing.Dict for annotations rather than dict itself due to dict being part of the BaseModel namespace (in the form of the deprecated dict() method). We correct two violations of this disclaimer in this PR, which currently cause downstream issues in packages that rely heavily on parsing of type-annotations, e.g. mitmproxy/pdoc#792.

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

Selected Reviewer: @Viicos

There is a disclaimer at top of file that mentions using `typing.Dict` for
annotations rather than `dict` itself due to `dict` being part of the
`BaseModel` namespace (in the form of the deprecated `dict()` method). We
correct two violations of this disclaimer in this PR, which currently cause
downstream issues in packages that rely heavily on parsing of type-annotations,
e.g. mitmproxy/pdoc#792.
@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label May 2, 2025
Copy link

codspeed-hq bot commented May 2, 2025

CodSpeed Performance Report

Merging #11834 will not alter performance

Comparing jinnovation:base-model-dict (0cf642b) with main (b0d701f)

Summary

✅ 46 untouched benchmarks

Copy link
Contributor

github-actions bot commented May 2, 2025

Coverage report

Click to see where and how coverage changed

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

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

@jinnovation
Copy link
Contributor Author

please review

@Viicos Viicos changed the title BaseModel: use typing.Dict for dunder annotations Use typing.Dict for BaseModel annotations May 2, 2025
Copy link
Member

@Viicos Viicos left a comment

Choose a reason for hiding this comment

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

Thanks, somehow we missed these ones

@Viicos Viicos merged commit fdaaeb0 into pydantic:main May 2, 2025
61 checks passed
@jinnovation jinnovation deleted the base-model-dict branch May 3, 2025 02:40
@Viicos Viicos added relnotes-ignore Omit this PR from the release notes. and removed ready for review relnotes-fix Used for bugfixes. labels May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes-ignore Omit this PR from the release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants