Check indexing operations [index]

Mypy checks that the indexed value in indexing operation such asx[y] supports indexing, and that the index expression has a validtype.

Example:

  1. a = {'x': 1, 'y': 2}
  2.  
  3. a['x'] # OK
  4.  
  5. # Error: Invalid index type "int" for "Dict[str, int]"; expected type "str" [index]
  6. print(a[1])
  7.  
  8. # Error: Invalid index type "bytes" for "Dict[str, int]"; expected type "str" [index]
  9. a[b'x'] = 4