title: Is there a way to check if function is recursive in python?
body: <p>I want to write a testing function for an exercise, to make sure a function is implemented correctly.<br>
  So I got to wonder, is there a way, given a function "foo", to check if it is implemented recursively? <br>
  If it encapsulates a recursive function and uses it it also counts. For example:</p>
  
  <pre><code>def foo(n):
      def inner(n):
          #more code
          inner(n-1)
      return inner(n)
  </code></pre>
  
  <p>This should also be considered recursive. <br>
  Note that I want to use an <em>external</em> test  function to perform this check. Without altering the original code of the function.</p>