title: How to use Python decorators to check function arguments?
body: <p>I would like to define some generic decorators to check arguments before calling some functions.</p>
  <p>Something like:</p>
  <pre><code>@checkArguments(types = ['int', 'float'])
  def myFunction(thisVarIsAnInt, thisVarIsAFloat)
      ''' Here my code '''
      pass
  </code></pre>
  <p>Side notes:</p>
  <ol>
  <li>Type checking is just here to show an example</li>
  <li>I'm using Python 2.7 but Python 3.0 whould be interesting too</li>
  </ol>
  <p>EDIT 2021: funny that type checking did not go antipythonic in the long run with <a href="https://docs.python.org/3/library/typing.html" rel="noreferrer">type hinting</a> and <a href="https://mypy.readthedocs.io/en/stable/" rel="noreferrer">mypy</a>.</p>