title: What is the difference between dict.items() and dict.iteritems() in Python2?
body: <p>Are there any applicable differences between <a href="http://docs.python.org/library/stdtypes.html#dict.items" rel="noreferrer"><code>dict.items()</code></a> and <a href="http://docs.python.org/library/stdtypes.html#dict.iteritems" rel="noreferrer"><code>dict.iteritems()</code></a>?</p>
  
  <p>From the <a href="https://docs.python.org/2/library/stdtypes.html#mapping-types-dict" rel="noreferrer">Python docs</a>:</p>
  
  <blockquote>
    <p><code>dict.items()</code>: Return a <strong>copy</strong> of the dictionary’s list of (key, value) pairs.</p>
    
    <p><code>dict.iteritems()</code>: Return an <strong>iterator</strong> over the dictionary’s (key, value) pairs.</p>
  </blockquote>
  
  <p>If I run the code below, each seems to return a reference to the same object. Are there any subtle differences that I am missing?</p>
  
  <pre><code>#!/usr/bin/python
  
  d={1:'one',2:'two',3:'three'}
  print 'd.items():'
  for k,v in d.items():
     if d[k] is v: print '\tthey are the same object' 
     else: print '\tthey are different'
  
  print 'd.iteritems():'   
  for k,v in d.iteritems():
     if d[k] is v: print '\tthey are the same object' 
     else: print '\tthey are different'   
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>d.items():
      they are the same object
      they are the same object
      they are the same object
  d.iteritems():
      they are the same object
      they are the same object
      they are the same object
  </code></pre>