Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Simplify unions involvingAny
orNever
when replacing type variables#10338
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
f4d6be3
to9097bd2
Comparecloudflare-workers-and-pagesbot commentedSep 6, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Deploying pydantic-docs with |
Latest commit: | 9097bd2 |
Status: | ✅ Deploy successful! |
Preview URL: | https://fcd106ae.pydantic-docs.pages.dev |
Branch Preview URL: | https://simplify-any-never-unions.pydantic-docs.pages.dev |
codspeed-hqbot commentedSep 6, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
CodSpeed Performance ReportMerging#10338 willnot alter performanceComparing Summary
|
Coverage reportClick to see where and how coverage changed
This report was generated bypython-coverage-comment-action |
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.
Awesome! Thanks for the inline comments, makes this super easy to review / understand for future devs.
287c266
intomainUh oh!
There was an error while loading.Please reload this page.
Change Summary
I could have implemented this simplification for all cases (perhaps in
GenerateSchema._apply_single_annotation
or similar) but I don't want to break any unusual scenarios, plus this kind of situation is pretty uncommon in the general case (you're not really going to annotate a field asAny | <other>
), it only makes sense when parameterizingT | <other>
withAny
/Never
.This has the added benefit of creating simplified JSON Schemas, as shown in the test.
Related issue number
Checklist