Open
Description
This code:
d = {k: v for k, v in []}
gives
nothingiterable.py:1: error: '<nothing>' object is not iterable
(The real code this was derived from had vals or []
, not just []
, and mypy had concluded that vals
was of type None
, for unrelated bogus reasons).
I realize mypy doesn't know the type of list elements for an empty list, but it seems like in the case of an empty list literal it would be possible to realize that it doesn't matter, and the resulting type of d
could be an uninhabited dictionary?