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
Some obvious type issues with coroutines are not detected. See two examples below.
coroutines
To Reproduce
import asyncio async def function_one(): return 1 async def function_two(): function_one()[1] function_one() + 1 asyncio.run(function_two())
Expected Behavior
mypy should detect two TypeError here:
mypy
TypeError
'coroutine' object is not subscriptable
unsupported operand type(s) for +: 'coroutine' and 'int'
Actual Behavior
Success: no issues found in 1 source file
Your Environment
mypy 0.910 Python 3.9.6
The text was updated successfully, but these errors were encountered:
https://mypy.readthedocs.io/en/stable/common_issues.html#no-errors-reported-for-obviously-wrong-code
Sorry, something went wrong.
Odd, a couroutine is never indexable, shouldn't mypy be able to detect this even if it's not type-annotated?
It can, yes, but mypy simply never provides errors for functions that aren't type checked.
You can use the --check-untyped-defs option to change this behavior.
--check-untyped-defs
No branches or pull requests
Bug Report
Some obvious type issues with
coroutines
are not detected. See two examples below.To Reproduce
Expected Behavior
mypy
should detect twoTypeError
here:'coroutine' object is not subscriptable
unsupported operand type(s) for +: 'coroutine' and 'int'
Actual Behavior
Success: no issues found in 1 source file
Your Environment
mypy 0.910
Python 3.9.6
The text was updated successfully, but these errors were encountered: