mypy
mypy copied to clipboard
(🎁) Infer local partial type when using `extend` with generator
a = [] # main.py:1: error: Need type annotation for "a" (hint: "a: List[<type>] = ...")
a.extend(a for a in [1])
reveal_type(a) # main.py:3: note: Revealed type is "builtins.list[Any]"