title: function annotations in python
body: <p>I just discovered function annotations for python 3 (<a href="https://www.python.org/dev/peps/pep-3107/" rel="nofollow">https://www.python.org/dev/peps/pep-3107/</a>) which seems great for documenting parameters or return types. It also makes better intellisense available in my pycharm IDE.</p>
  
  <p>I have a question regarding parameters where the input type is fuzzy. For example, it could be a list or numpy array or some "array-like" quantity. What is the best way to annotate such an input parameter to the function? Example:</p>
  
  <pre><code>import numpy as np
  
  def fun(data: np.ndarray) # can also be a list
      pass
  </code></pre>
  
  <p>I have another case where the input can be any of the two types. Example:</p>
  
  <pre><code>def fun(header: Nifti1Header) # can also be Nifti2Header
      pass
  </code></pre>
  
  <p>What is the best way to document these kinds of parameter inputs?</p>