-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ty] Add into_callable method for Type #19130
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
AlexWaygood
left a comment
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.
This is great! I think it's exactly the direction we want to head in, as it will make subtyping/assignability between various types and protocols with __call__ methods easier too.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
…into into-callable
|
Seems like they're caught in mypy primer, ill make them return None but add a todo comment |
carljm
left a comment
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.
This looks great, thank you!
cc @abhijeetbodas2001, I think my review comments on your returns-Never PR mentioned wanting this method.
Summary
Was just playing around with this, there's definitely more to do with this function, but it seems like maybe a better option than having so many arms in has_relation_to for (_, Callable).
Not super invested in this but wanting to hear opinions if people have time