-
-
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
Union types and generics #4432
Comments
That seems wishful thinking. If you expand the generics in The problem with |
Yea, I think I understand why it is not working at the moment. But hopefully it will could work. So how I see is that
Less fancy than |
TBH, I don't see an issue here (apart from As a side note, maybe we should add an issue template? (GitHub supports this.) For me personally it would be easier to see these points:
@gvanrossum @JukkaL What do you think? |
Well, Mitar has a feature request formulated as a bug report. That's a
classic issue tracker fail, and a template would just make it worse IMO.
But feel free to set up a template, as long as it's also easy to ignore
when people don't need the guidance.
|
It is jut plain text placed initially in the issue, one can edit it or remove completely. I will make one now, and we will see how it goes. |
OK, here is the PR #4433 |
I provided that in the initial issue text? There is code, which mypy I ran, current output, and expected output is the last two lines of the mypy output.
Oh, sorry, I thought it was clear that is a feature request. Is there some other/better way to submit features requests? In README it says that issues are for feature requests as well:
|
You don't explicitly say whether or not this is a feature request or bug report, so being explicit about that at the beginning would be helpful. |
Sorry about that. Yea, it is a feature request. |
I am closing this issue in favor of #6746 where I tried to describe in more detail what I am doing, what I tried, and how it does not work. |
I have this example:
When I run mypy (
mypy===0.570-dev-1aba774cc00b49627b86f95c8172adbb12b52891
), I get:Ideally,
Numbers1
should work likeNumbers3
, or at leastNumbers2
should. But currently it seems like onlyNumbers3
make a strict return type and not union type. It is sad that I have to reimplementdo
method just to get correct return types. This is really going against DRY principle.The text was updated successfully, but these errors were encountered: