Page MenuHomeSoftware Heritage
Paste P972

mypy wat
ActivePublic

Authored by vlorentz on Mar 11 2021, 4:28 PM.
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")

Event Timeline

vlorentz updated the paste's language from autodetect to python.