title: Test if function or method is normal or asynchronous
body: <p>How can I find out if a function or method is a normal function or an async function? I would like my code to automatically support normal or async callbacks and need a way to test what type of function is passed.</p>
  
  <pre><code>async def exampleAsyncCb():
      pass
  
  def exampleNomralCb():
      pass
  
  def isAsync(someFunc):
      #do cool dynamic python stuff on the function
      return True/False
  
  async def callCallback(cb, arg):
      if isAsync(cb):
          await cb(arg)
      else:
          cb(arg)
  </code></pre>
  
  <p>And depending on what type of function gets passed it should either run it normally or with await. I tried various things but have no idea how to implement <code>isAsync()</code>.</p>