title: itertools.groupby() not grouping correctly
body: <p>I have this data:</p>
  
  <pre><code>self.data = [(1, 1, 5.0),
               (1, 2, 3.0),
               (1, 3, 4.0),
               (2, 1, 4.0),
               (2, 2, 2.0)]
  </code></pre>
  
  <p>When I run this code:</p>
  
  <pre><code>for mid, group in itertools.groupby(self.data, key=operator.itemgetter(0)):
  </code></pre>
  
  <p>for <code>list(group)</code> I get:</p>
  
  <pre><code>[(1, 1, 5.0),
   (1, 2, 3.0),
   (1, 3, 4.0)]
  </code></pre>
  
  <p>which is what I want.</p>
  
  <p>But if I use 1 instead of 0</p>
  
  <pre><code>for mid, group in itertools.groupby(self.data, key=operator.itemgetter(1)):
  </code></pre>
  
  <p>to group by the second number in the tuples, I only get:</p>
  
  <pre><code>[(1, 1, 5.0)]
  </code></pre>
  
  <p>even though there are other tuples that have "1" in that 1 (2nd) position.</p>