Properly fetch PEP 695 type params for functions, do not fetch annotations from signature#11093
Merged
sydney-runkle merged 1 commit intomainfrom Dec 13, 2024
Merged
Properly fetch PEP 695 type params for functions, do not fetch annotations from signature#11093sydney-runkle merged 1 commit intomainfrom
sydney-runkle merged 1 commit intomainfrom
Conversation
Viicos
commented
Dec 11, 2024
| # 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, ...] = () |
Member
Author
There was a problem hiding this comment.
I somehow forgot to actually fetch the type params here 🤔
Member
Author
There was a problem hiding this comment.
Turns out the test did not use forward annotations, so it was fixed as well.
CodSpeed Performance ReportMerging #11093 will not alter performanceComparing Summary
|
d78f8b0 to
80251eb
Compare
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 |
…tions from signature We now unsupport built-in functions.
80251eb to
61e935d
Compare
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||
1 similar comment
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||
sydney-runkle
approved these changes
Dec 12, 2024
Contributor
sydney-runkle
left a comment
There was a problem hiding this comment.
Looking good overall, added a few follow up questions. Thanks!
| 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. |
36 tasks
Merged
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11076, fixes #11073.
Turns out discussion in #10484 (comment) was relevant, as not using
get_function_type_hintswould skip theNone -> NoneTypeconversion, and other things might happen as well.Change Summary
Related issue number
Checklist