title: How to avoid depth recursion in nested functions with python
body: <p>Say we have this code:</p>
  
  <pre><code>a = 1
  
  def func1():
      if a == 1:
          func2()
  
  def func2():
      if a == 1:
          func3()
  
  def func3():
      func1()
  </code></pre>
  
  <p>Is there a way we could make func3 call func1 <em>stepping out</em> of the 'parent functions' it already incurred in? Meaning, going back to 'recursion depth 0', as if it was starting fresh?</p>
  
  <p>Thank you!</p>