title: Is there another way to iterate an identical for loop of dictionaries to infinite?
body: <p>To be clearer I have a code formatted like the one below and is there a way to refactor it?</p>
  
  <pre><code>def func(value):
      # something / break the script when error occurs
      return dict()
  
  
  d0 = dict()
  for k0, v0 in d0.items():
      d1 = func(v0)
      for k1, v1 in d1.items():
          d2 = func(v1)
          for k2, v2 in d2.items():
              d3 = func(v2)
              for k3, v3 in d3.items():
                  d4 = func(v3)
                  for k4, v4 in d4.items():
                      d5 = func(v4)
                      for k5, v5 in d5.items():
                          # ... infinite
  </code></pre>