Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Properly fetch PEP 695 type params for functions, do not fetch annotations from signature#11093
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
@@ -123,7 +125,11 @@ def ns_for_function(obj: Callable[..., Any], parent_namespace: MappingNamespace | |||
# passed as a separate argument. However, internally, `_eval_type` calls | |||
# `ForwardRef._evaluate` which will merge type params with the localns, | |||
# essentially mimicking what we do here. | |||
type_params: tuple[TypeVar, ...] = () |
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.
I somehow forgot to actually fetch the type params here 🤔
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.
Turns out the test did not use forward annotations, so it was fixed as well.
codspeed-hqbot commentedDec 11, 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#11093 willnot alter performanceComparing Summary
|
d78f8b0
to80251eb
Comparecloudflare-workers-and-pagesbot commentedDec 12, 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: | 61e935d |
Status: | ✅ Deploy successful! |
Preview URL: | https://d47ea3e5.pydantic-docs.pages.dev |
Branch Preview URL: | https://validate-call-fixes.pydantic-docs.pages.dev |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
…tions from signatureWe now unsupport built-in functions.
80251eb
to61e935d
CompareCoverage reportClick to see where and how coverage changed
This report was generated bypython-coverage-comment-action |
1 similar comment
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.
Looking good overall, added a few follow up questions. Thanks!
@@ -1832,13 +1832,7 @@ def _call_schema(self, function: ValidateCallSupportedTypes) -> core_schema.Call | |||
if p.annotation is sig.empty: | |||
annotation = typing.cast(Any, Any) | |||
else: | |||
# Note: This was originally get by `_typing_extra.get_function_type_hints`, | |||
# but we switch to simply `p.annotation` to support bultins (e.g. `sorted`). | |||
# May need to revisit if anything breaks. |
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.
Haha, yikes.
Uh oh!
There was an error while loading.Please reload this page.
d19368a
intomainUh oh!
There was an error while loading.Please reload this page.
Fixes#11076,fixes#11073.
Turns out discussion in#10484 (comment) was relevant, as not using
get_function_type_hints
would skip theNone -> NoneType
conversion, and other things might happen as well.Change Summary
Related issue number
Checklist