-
-
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 is confused by return values from generators #695
Comments
I've been fixing this (see spkersten/generator). Type checking return already works in that branch, only
|
@spkersten, do you still have that branch? If not I'm probably going to look into this -- there also seems overlap with #642 and #1011. |
FWIW, I think that the example using
We could treat Iterator[X] as Generator[X, Y, Z] except I still think that even |
I'm @ddfisher now! |
Added @ddfisher. |
This is fine:
But now try this:
This complains about the
return
statement:It's matching the generator return value (which is only accessible by a caller that uses
yield from
) to the declared return type (which is just the type of what you get by callingfoo()
.The text was updated successfully, but these errors were encountered: