title: python recursive generator fail
body: <p>I've got nested json object it contains lists and dicts.. and I want to search it for all 'foo' keys inside.
  I'm trying to do recursive generator but function fail on second call of parse dunno why, I even see 'in' output only once. Looks like interpreter do not get inside parse second time etc.. Help me understand where I'am wrong?</p>
  
  <pre><code>def parse(d,key):
      print('in')
      if type(d)==type({}):
          if key in d:
              yield d[key]
          for k in d:
              parse(d[k],key)
      if type(d)==type([]):
          for i in d:
              parse(i,key)
  </code></pre>