title: What is the id( ) function used for?
body: <p>I read <a href="http://docs.python.org/2/library/functions.html#id" rel="noreferrer">the Python 2 docs</a> and noticed the <code>id()</code> function:</p>
  
  <blockquote>
    <p>Return the “identity” of an object. This is an integer (or long integer) which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the same id() value.</p>
    
    <p>CPython implementation detail: This is the address of the object in memory.</p>
  </blockquote>
  
  <p>So, I experimented by using <code>id()</code> with a list:</p>
  
  <pre><code>&gt;&gt;&gt; list = [1,2,3]
  &gt;&gt;&gt; id(list[0])
  31186196
  &gt;&gt;&gt; id(list[1])
  31907092 // increased by 896
  &gt;&gt;&gt; id(list[2])
  31907080 // decreased by 12
  </code></pre>
  
  <p>What is the integer returned from the function? Is it synonymous to memory addresses in C? If so, why doesn't the integer correspond to the size of the data type?</p>
  
  <p>When is <code>id()</code> used in practice?</p>