I see mypy more as a refactoring tool, but I'm always pleasantly surprised when it catches issues. It caught a bug here! demo.py:96: error: Unsupported operand types for >= ("int" and "Optional[int]") (In the code I've checked max_val is not None, but used min_val.)