Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Fix type hint ofField.default
to be compatible with Python 3.8 and 3.9#10972
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
cloudflare-workers-and-pagesbot commentedNov 25, 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: | 1fb04ac |
Status: | ✅ Deploy successful! |
Preview URL: | https://73a3bb43.pydantic-docs.pages.dev |
Branch Preview URL: | https://ellipsis-compat.pydantic-docs.pages.dev |
codspeed-hqbot commentedNov 25, 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#10972 willimprove performances by 5.55%Comparing Summary
Benchmarks breakdown
|
… 3.9For Python < 3.10, we define `EllipsisType = type(Ellipsis)` in`_typing_extra`. `EllipsisType` is then used in a type expressionbut pyright raises an error because `EllipsisType` is defined asvariable.Instead, we make use of the `ellipsis` builtin, only availablefor type checkers (defined in typeshed) as a compatibility hack.
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.
Nice work, thanks
a67002a
intomainUh oh!
There was an error while loading.Please reload this page.
… 3.9 (#10972)For Python < 3.10, we define `EllipsisType = type(Ellipsis)` in`_typing_extra`. `EllipsisType` is then used in a type expressionbut pyright raises an error because `EllipsisType` is defined asvariable.Instead, we make use of the `ellipsis` builtin, only availablefor type checkers (defined in typeshed) as a compatibility hack.
Fixes#10971.
For Python < 3.10, we define
EllipsisType = type(Ellipsis)
in_typing_extra
.EllipsisType
is then used in a type expression but pyright raises an error becauseEllipsisType
is defined as variable.Instead, we make use of the
ellipsis
builtin, only available for type checkers (defined in typeshed) as a compatibility hack.Change Summary
Related issue number
Checklist