-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add generics support for v2 (another attempt) #5125
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments but on the whole I think we should merge this asap.
I still believe that generic_recursion_self_type
and friends could be simplified if we adopt something like #5149. However:
- I don't pretend to know enough to be sure
- If those simplifications aren't possible, it's fine
- this shouldn't block merging
I agree it's hard to reason about, so I also don't pretend to be confident, but I think the main thing that has the potential to simplify the complex recursion stuff would be if the At any rate, agree with all the above feedback, I'll make the changes and merge once they are complete. |
Note: this requires an updated version of
pydantic_core
, but is currently passing all tests againstpydantic_core
's main branch.There is still one major failing test I haven't resolved yet, which is getting it to work properly with "deep" recursive generic models. Figuring that out is my goal for tomorrow, but I wanted to open this now for the purposes of review.
@samuelcolvin you mentioned that the dataclasses stuff might blow this up, I'll be happy to merge it all together when that's ready.
fix #5146