title: What is the advantage of iteritems?
body: <p>I am using Python 2.7.5 @ Mac OS X 10.9.3 with 8GB memory and 1.7GHz Core i5. I have tested time consumption as below.</p>
  
  <pre><code>d = {i:i*2 for i in xrange(10**7*3)} #WARNING: it takes time and consumes a lot of RAM
  
  %time for k in d: k,d[k]
  CPU times: user 6.22 s, sys: 10.1 ms, total: 6.23 s
  Wall time: 6.23 s
  
  %time for k,v in d.iteritems(): k, v
  CPU times: user 7.67 s, sys: 27.1 ms, total: 7.7 s
  Wall time: 7.69 s
  </code></pre>
  
  <p>It seems iteritems is slower.
  I am wondering what is the advantage of iteritems over directly accessing the dict.</p>
  
  <p>Update:
  for a more accuracy time profile</p>
  
  <pre><code>In [23]: %timeit -n 5 for k in d: v=d[k]
  5 loops, best of 3: 2.32 s per loop
  
  In [24]: %timeit -n 5 for k,v in d.iteritems(): v
  5 loops, best of 3: 2.33 s per loop
  </code></pre>