-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
mypy incorrectly disallows "yield from ()" #4444
Comments
Hm, apparently this is is because return (is_subtype(type, self.named_generic_type('typing.Iterable',
[AnyType(TypeOfAny.special_form)])) and
isinstance(type, Instance)) I have no idea why one needs that last |
Trying to test things out; apparently, removal of the Failing tests output
|
@hoefling Have you tried the second idea I mentioned? But in any case it looks like this requires a more careful solution than I thought. |
Adding the
On the current master, the test fails with the message: Unfortunately, with the I'm not sure, though, if I wrote the test correctly - please double-check. |
Yes, this is what I was afraid of, this will require some treatment of tuple fallbacks (and they have their own issues). |
ping |
@nitzo please do not ping the mypy bug tracker like this. It is quite rude. If an issue hasn't been fixed yet, it is because people are hard at work on other features. If you want to see something fixed sooner, submit a PR for it |
Fixes #4444 by removing special-casing for instance types. Now `yield from <tuple>` works as expected.
Fixes python#4444 by removing special-casing for instance types. Now `yield from <tuple>` works as expected.
yield from []
is allowed by mypyyield from ()
gives:The text was updated successfully, but these errors were encountered: