title: Can I make type aliases for type constructors in python using the typing module?
body: <p>Since python version 3.5, you can use type hints to indicate what type of arguments a function is expecting. I find these type hints extremely valuable for documentation purposes, so I try to use them as much as I can. They also help the linter and therefore regularly save me from bugs introduced by code changes.</p>
  
  <p>For example, in my code I have a few functions which take a zero-argument function as an argument. E.g.:</p>
  
  <pre><code>def onReady(f: Callable[[], Any]) -&gt; None:
      ...
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>def checkIfReady(f: Callable[[], Bool]) -&gt; None:
      ...
  </code></pre>
  
  <p>What I would like to do is make a type alias like so (the code below is not valid python):</p>
  
  <pre><code>Action[A] = Callable[[], A]
  </code></pre>
  
  <p>And then I could shorten my types for the arguments above:</p>
  
  <pre><code>def onReady(f: Action[Any]) -&gt; None:
      ...
  </code></pre>
  
  <p>I know I can make a type alias for a specific instance, e.g.:</p>
  
  <pre><code>ActionBool = Callable[[], bool]
  </code></pre>
  
  <p>And I know of the existance of <code>NewType</code> in the <code>typing</code> module, but neither of these seem to generalize to higher order types.</p>