title: Mypy Invalid index type "str" for "Union[str, Dict[str, str]]"; expected type "Union[int, slice]"
body: <p>Why am I getting the error? I have added the type properly, right?</p>
  <pre><code>Invalid index type &quot;str&quot; for &quot;Union[str, Dict[str, str]]&quot;; expected type &quot;Union[int, slice]&quot;
  </code></pre>
  <p>Code</p>
  <pre><code>from typing import List, Dict, Union
  
  d = {&quot;1&quot;: 1, &quot;2&quot;: 2}
  
  listsOfDicts: List[Dict[str, Union[str, Dict[str, str]]]] = [
      {&quot;a&quot;: &quot;1&quot;, &quot;b&quot;: {&quot;c&quot;: &quot;1&quot;}},
      {&quot;a&quot;: &quot;2&quot;, &quot;b&quot;: {&quot;c&quot;: &quot;2&quot;}},
  ]
  
  [d[i[&quot;b&quot;][&quot;c&quot;]] for i in listsOfDicts]
  </code></pre>