-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
use base type as hint when inferring #12284
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
Would help with python#12268. Modified a test because the two behaviours conflict right now.
This comment has been minimized.
This comment has been minimized.
To motivate this PR, consider the following code (which is also a test case): from typing import Union, List
class A: pass
class B: pass
U = Union[A, B]
class Base:
variable1 : List[U] = []
variable2 : List[U] = []
class Derived(Base):
variable1 = [A()]
variable2 = variable1 before this PR, although |
Note that this hinting is already done, in order to infer |
Since the issue is open, I think it's fair to say that this would fix #12268 |
Sorry for a bit of spam, normally I'd force push, I can't force github to link the issue, for some reason. |
I give up. Maybe a maintainer can help. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Hey, I think this PR is ready for someone to look over. It's been around two weeks, and I don't want it to get lost in the sea of PRs. Does anyone mind taking a look? |
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 the PR! I believe this was fixed in #13494
Would help with #12268. Modified a test because the two behaviours conflict right now.