Check list items [list-item]

When constructing a list using [item, …], mypy checks that each itemis compatible with the list type that is inferred from the surroundingcontext.

Example:

  1. from typing import List
  2.  
  3. # Error: List item 0 has incompatible type "int"; expected "str" [list-item]
  4. a: List[str] = [0]