title: python groupby behaviour?
body: <blockquote>
  <pre><code>&gt;&gt;from itertools import groupby
  &gt;&gt;keyfunc = lambda x : x &gt; 500
  &gt;&gt;obj = dict(groupby(range(1000), keyfunc))
  &gt;&gt;list(obj[True])
  [999]
  &gt;&gt;list(obj[False])
  []
  </code></pre>
  </blockquote>
  
  <p><em>range(1000)</em> is obviously sorted by default for the condition (x > 500).
  <br/>I was expecting the numbers from 0 to 999 to be grouped in a <em>dict</em> by the condition (x > 500). But the resulting dictionary had only 999.
  <br/>where are the other numbers?.
  Can any one explain what is happening here?</p>