We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bug Report
As of Python 3.13, it is possible to return a value from a simple coroutine (generator): python/cpython#104770
This is supported by the type hints. However, Mypy does not consider the generator/coroutine annotation to determine the return type of close().
close()
To Reproduce
https://mypy-play.net/?mypy=latest&python=3.13&gist=c1ef127cdbc6359a99c346b0ee15c8b5
Expected Behavior
If the simple coroutine (generator) f is annotated to return a type (e.g. int), then the call to f.close() should be recognized as returning an int.
f
int
f.close()
Actual Behavior
error: "close" of "Generator" does not return a value (it only ever returns None) [func-returns-value]
Your Environment
mypy.ini
[tool.mypy] strict = true enable_incomplete_feature = ["NewGenericSyntax"] # only needed until PEP 695 is fully supported
The text was updated successfully, but these errors were encountered:
Thanks! This looks like an issue with Generator's stubs in typeshed. I opened #13127
Generator
Sorry, something went wrong.
Generator.close
Successfully merging a pull request may close this issue.
Bug Report
As of Python 3.13, it is possible to return a value from a simple coroutine (generator): python/cpython#104770
This is supported by the type hints. However, Mypy does not consider the generator/coroutine annotation to determine the return type of
close()
.To Reproduce
https://mypy-play.net/?mypy=latest&python=3.13&gist=c1ef127cdbc6359a99c346b0ee15c8b5
Expected Behavior
If the simple coroutine (generator)
f
is annotated to return a type (e.g.int
), then the call tof.close()
should be recognized as returning anint
.Actual Behavior
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: