I was surprised that some code like this wasn't flagged by mypy:
test.py:12: error: Unsupported operand types for > ("int" and "None")
-
What are the versions of mypy and Python you are using?
mypy 0.782, python 3.8.2
-
What are the mypy flags you are using? (For example --strict-optional)
follow_imports=normal
warn_redundant_casts=True
warn_unused_ignores=True
strict_optional=True
strict_equality=True
no_implicit_optional=True
disallow_untyped_defs=True
disallow_any_generics=True
I was surprised that some code like this wasn't flagged by mypy:
What is the actual behavior/output?
No error.
What is the behavior/output you expect?
I would expect a similar warning as I get if I do
1 > NoneWhat are the versions of mypy and Python you are using?
mypy 0.782, python 3.8.2
What are the mypy flags you are using? (For example --strict-optional)
follow_imports=normal
warn_redundant_casts=True
warn_unused_ignores=True
strict_optional=True
strict_equality=True
no_implicit_optional=True
disallow_untyped_defs=True
disallow_any_generics=True