from typing import List def f() -> None: l1: List[str] = ["foo"] l2: List[int] = [42] if list(l1) and list(l2): # foo.py:6: error: Argument 1 to "list" has incompatible type "List[int]"; expected "Iterable[str]" print("hello")