title: Compare two type annotations (possibly generics) to see if they fit
body: <p>I'm looking for a function that can say if a type annotation is a subset of another.</p>
  <p>It could be in the standard library or 3rd-party. Since type-checkers such as mypy and pytype have solved this problem, I assume there is some function that can do this, but couldn't find it.</p>
  <p>e.g. a function <code>f</code> such that:</p>
  <pre><code>from typing import *
  
  f(Sequence, List) # True
  f(Sequence[str], List) # False
  f(Iterable[str], List[str]) # True
  f(List[str], Iterable[str]) # False
  f(str, str) # True
  f(int, str) # False
  </code></pre>
  <p><code>issubclass</code> works for actual types and simple type annotations,</p>
  <pre><code>issubclass(str, str) # True
  issubclass(int, str) # False
  issubclass(list, Sequence) # True
  issubclass(Iterable, Sequence) # False
  issubclass(Sequence, Iterable) # True
  </code></pre>
  <p>but not for generics:</p>
  <pre><code>issubclass(List[str], Iterable[str])
  </code></pre>
  <blockquote>
  <p>TypeError: Subscripted generics cannot be used with class and instance checks</p>
  </blockquote>
  <p>The high-level goal is be able to, given two functions, determine if they can be composed.</p>