title: What is the benefit to using typing library classes vs. types in Python type hints?
body: <p>I'm starting to learn type hints in Python to ease the future porting of code from Python to C. I am wondering what the difference is, if any, between using types directly in type hints vs. using the classes defined in the <code>typing</code> module.</p>
  
  <p>For example, the difference between</p>
  
  <pre><code>def somefn(a: list[int]) -&gt; tuple[str, int]:
      ...
  </code></pre>
  
  <p>and</p>
  
  <pre><code>from typing import List, Tuple
  
  def somefn(a: List[int]) -&gt; Tuple[str, int]:
      ...
  </code></pre>
  
  <p>It seems like some classes like <code>Union</code>, <code>Any</code>, <code>Callable</code>, and <code>Iterable</code> would be useful, but the utility of classes for data types that already exist as keywords in python is unclear to me.</p>