bug.py:
from __future__ import annotations
from typing import *
def foo() -> Optional[str]:
return None
if ((f := foo()) is None or f.lower()):
pass
$ mypy bug.py
bug.py:9: error: Item "None" of "Optional[str]" has no attribute "lower"
Found 1 error in 1 file (checked 1 source file)
bug.py: