Skip to content

Conversation

sydney-runkle
Copy link
Contributor

Fix #9690

@sydney-runkle sydney-runkle added the relnotes-change Used for changes to existing functionality which don't have a better categorization. label Jun 19, 2024
@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label Jun 19, 2024
Copy link

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: edefa6a
Status: ✅  Deploy successful!
Preview URL: https://82731b63.pydantic-docs.pages.dev
Branch Preview URL: https://create-model-typing-fix.pydantic-docs.pages.dev

View logs

@sydney-runkle sydney-runkle removed the relnotes-fix Used for bugfixes. label Jun 19, 2024
Copy link

codspeed-hq bot commented Jun 19, 2024

CodSpeed Performance Report

Merging #9697 will not alter performance

Comparing create_model_typing_fix (edefa6a) with main (668c728)

Summary

✅ 13 untouched benchmarks

Copy link
Contributor

@dmontagu dmontagu left a comment

Choose a reason for hiding this comment

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

LGTM but @adriangb I'd be curious if you have any objections/alternative suggestions for resolving #9690 given your familiarity with the typing of validators/etc.

I suggested this approach to @sydney-runkle given I think getting specific typing here is not very necessary given how exotic/advanced this usage of create_model is, but I'd be open to narrower type hints if they were robust to different type checkers and all the things we actually currently support. (And if you think it is even worth being more specific than Callable[..., Any].)

@sydney-runkle
Copy link
Contributor Author

Thanks @dmontagu @adriangb!

@sydney-runkle sydney-runkle merged commit c66288a into main Jun 19, 2024
@sydney-runkle sydney-runkle deleted the create_model_typing_fix branch June 19, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes-change Used for changes to existing functionality which don't have a better categorization.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mypy error on __validators__ when using create_model
3 participants