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
Can't generate schema when typing.Never
is involved
#1038
Comments
I don't think |
@adriangb Not sure what you mean there: I even believe this kind of use was intended given that:
Note: if the field's type was |
I can see how |
pydantic
fails to generate a schema fortyping.Never
; I ran into this in a model generic over aTypeVar
whose bound involvedNever
.Error encountered
Test case
Workarounds
In this particular case, removing the bounds on
T
works, but is highly undesirable: one could then instantiate things likeGenericConfig[int]
without type-checking error.I attempted to provide the schema manually, but couldn't get that to work:
I'm assuming the
handler(tp)
call is the problem, but I couldn't find a way to directly construct aCoreSchema
.The text was updated successfully, but these errors were encountered: