title: PIL and python static typing
body: <p>I have a function argument which can accept several types for an image:</p>
  
  <pre class="lang-py prettyprint-override"><code>def somefunc(img: Union[np.array, Image, Path, str]):
  </code></pre>
  
  <p>The PIL <code>Image</code> in this case throws the following exception:</p>
  
  <pre class="lang-py prettyprint-override"><code>TypeError: Union[arg, ...]: each arg must be a type. Got &lt;module 'PIL.Image' from ...
  </code></pre>
  
  <p>Which makes sense after inspecting an image object further:</p>
  
  <pre class="lang-py prettyprint-override"><code>print(type(Image.open('someimage.tiff')))
  &gt;&gt;&gt; &lt;class 'PIL.TiffImagePlugin.TiffImageFile'&gt;
  </code></pre>
  
  <p>How would I go about specifying a generalized type for a PIL image? It being from a file and it's format should be irrelevant.</p>