Closed
Description
Bug Report
To Reproduce
Run this file to test.py
:
if 'red' == 5: # <-- Mypy finds error
print('equal')
def foo():
if 'red' == 5: # <-- Mypy does not find error
print('equal')
foo()
then execute
mypy test.py --strict-equality
Expected Behavior
Mypy should find 2 errors in this file.
Actual Behavior
Mypy fails to find the error inside the function.
Your Environment
- Mypy version used: 0.8000
- Mypy command-line flags:
--strict-equality
- Mypy configuration options from
mypy.ini
(and other config files): None - Python version used: 3.9.1
- Operating system and version: Ubuntu 18.04
Metadata
Metadata
Assignees
Labels
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
hauntsaninja commentedon Feb 9, 2021
First item of https://mypy.readthedocs.io/en/stable/common_issues.html#no-errors-reported-for-obviously-wrong-code
Garrett-R commentedon Feb 9, 2021
Ah, my apologies! Thank you for your time and thanks for the package!