title: Understanding Recursion "local" variable in Python
body: <p>I'm just learning about recursion and am trying to apply it in some for-fun, come-to-understand-it ways. (Yes, this whole thing is better done by three nested for loops)</p>
  
  <pre><code>def generate_string(current_string, still_to_place):
      if still_to_place:
          potential_items = still_to_place.pop(0)
          for item in potential_items:
              generate_string(current_string + item, still_to_place)
              #print("Want to call generate_string({}, {})".format(current_string + item, still_to_place))
      else:
          print(current_string)
  generate_string("", [['a','b','c'],['d','e','f'],['g','h','i']])
  </code></pre>
  
  <p>If I comment out the recursive call and uncomment the print, it prints exactly what I'd hope it would be calling. However, just uncommenting the print shows that it calls an empty still_to_place array even when it should still have the [d,e,f], [g,h,i] from the "higher up" recursion I think.</p>
  
  <p>What am I missing in my understanding? Thanks!</p>