-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Treat type equivalent to Type[Any] #2825
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
Instead of fixing this up in one particular place, I think it'd be better to actually translate all |
I would expect |
@ddfisher I don't think it is a good idea to translate However, I agree that it makes sense to translate @elazarg Currently all |
@@ -168,7 +168,7 @@ def test_var_arg_callable_subtyping_9(self) -> None: | |||
self.fx.callable_var_arg(0, self.fx.b, self.fx.d)) | |||
|
|||
def test_type_callable_subtyping(self) -> None: | |||
self.assert_strict_subtype( | |||
self.assert_subtype( |
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.
Why this change? It doesn't seem right to me.
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.
Ah, nevermind -- I see the preexisting comment about it in visit_type_type
.
That a good point -- I guess we can't translate |
I am not sure why we can't - we can always special case the places where Python happen "not to work the way it ought to" (we won't forget this information). |
@ddfisher Surprisingly (or rather not) it is already treated correctly everywhere else where I found. For example, |
@ddfisher Are you happy with this PR? Or should I make more changes? (If you don't have time now, just ignore this ping) |
@ddfisher Sorry for pinging again. Are you happy with this PR now? |
minor spelling fix in comment
Fixes #2655
As discussed in typing docs,
Type[Any]
is equivalent to plaintype
.is_subtype
was checking this only one side, here I add the opposite side.