title: Make a simple Python dictionary generator
body: <p>Here is a sample code basically doing an iteration.</p>
  
  <pre><code>&gt;&gt;&gt; d = {'lol': {'12': '3',  '35':''}, 'w': {'12': '3', '35':''}}
  
  &gt;&gt;&gt; def iteritems(s):
  ...     keys = s.keys()
  ...     for key in keys:
  ...             yield key, s[key]
  ... 
  &gt;&gt;&gt; for k, v in iteritems(d):
  ...     print k, v
  ... 
  w {'12': '3', '35': ''}
  lol {'12': '3', '35': ''}
  </code></pre>
  
  <p>This is a valid generator. But the generator <code>iteritems</code> have to call <code>s.keys()</code> to cache all the keys in the dictionary. If the dictionary is large (over 100 items), that's not memory efficient. </p>
  
  <p>But since dictionary is not an ordered structure, I assume that getting that list of keys is a must. </p>
  
  <p>One may argue: the number of keys is far less than the number of items counting keys and values.</p>
  
  <p>Any suggestion? Or better way (and of course I need to support nested iteation but that's another thing).</p>