Conversation
msullivan
commented
Sep 26, 2025
Comment on lines
+65
to
+70
| atype = args[0] | ||
| if isinstance(atype, TypeVar): | ||
| atype = atype.__bound__ | ||
| ns = _namespace.module_ns_of(fn) | ||
| atype = _typing_eval.resolve_type(atype, globals=ns) | ||
|
|
Member
Author
There was a problem hiding this comment.
@elprans I don't think I understand the runtype type representations to know whether this is sufficient; could we be hitting TypeVars in other cases?
Why do we have to do this special mro stuff?
Member
There was a problem hiding this comment.
Potentially we might have nested typevars in functions of collections, e.g list[T], but I think that's currently broken, so doesn't need to be in this PR.
Member
There was a problem hiding this comment.
Why do we have to do this special mro stuff?
That is for ExprAlias and friends I think.
elprans
approved these changes
Sep 30, 2025
This was referenced Oct 2, 2025
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.
Currently only the overloaded scalar cases seem to work for functions
taking typevars. Handle them by having _typing_dispatch look at
typevar bounds.