-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[do not merge] Fixes type inference for generic calls in if expr #15140
base: master
Are you sure you want to change the base?
Conversation
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.
Thank you for reviving this!
[case testUnificationEmptySetRight] | ||
def f(): pass | ||
a = {0} if f() else set() | ||
a() # E: "Set[int]" not callable |
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.
a() # E: "Set[int]" not callable | |
reveal_type(a()) # N: Revealed type is "Set[int]" |
@@ -10,7 +10,8 @@ class object: | |||
class type: pass | |||
class tuple(Generic[T]): pass | |||
class function: pass | |||
class int: pass | |||
class int: | |||
def conjugate(self) -> int: pass |
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 think we can use our own classes here, so we can simplify the stub
This is @sobolevn 's work from #11128, resubmitting since the old PR can't be saved because Nikita's repo got deleted