title: How to subclass a dictionary so it supports generic type hints?
body: <p>How can a dictionary be subclassed such that the subclass supports generic type hinting? It needs to behave like a dictionary in every way and support type hints of the keys and values.  The subclass will add functions that access and manipulate the dictionary data. For example, it will have a <code>valueat(self, idx:int)</code> function that returns the dictionary value at a given index.</p>
  <p>It doesn't require <code>OrderedDict</code> as its base class, but the dictionary does need to have a predictable order. Since <code>OrderedDict</code> maintains insertion order and supports type hints, it seems like a reasonable place to start.
  Here's what I tried:</p>
  <pre><code>from collections import OrderedDict
  
  class ApplicationSpecificDict(OrderedDict[str, int]):
      ...
  </code></pre>
  <p>However, it fails with the error:
  <code>TypeError: 'type' object is not subscriptable</code></p>
  <p>Is this not supported in Python 3.7+, or am I missing something?</p>