title: Catch bad signature error for an specific function call
body: <p>I could have a code like this:</p>
  
  <pre><code>def sum(a, b):
      return a + b
  
  # User chooses function and parameters
  function = sum
  params = {"a": 5, "b": 3}
  
  try:
      ret = sum(**params)
      print(ret)
  except TypeError:
      # Function called with bad signature
      print("Wrong parameters for the chosen function!")
  except:
      print("Internal error")
  </code></pre>
  
  <p>The user of the module would choose a function and a dictionary of params. The function is run and the user gets told if the parameters of sum are wrong (because calling a function with incorrect parameters would raise a <code>TypeError</code>). If the function is bugged and raises other type of exception, 'internal error' is shown.</p>
  
  <p><strong>Well, almost.</strong> The <code>sum</code> function could be bugged and raise <code>TypeError</code> because of a bad call made inside the function. That should be reported as an internal error.</p>
  
  <p>How can I catch the case where the <code>sum</code> function is called with wrong parameters and avoid false positives when a <code>TypeError</code> is raised within the function?</p>