title: Why is my list not sorted as expected?
body: <p>I have a <code>dict()</code> called <code>twitter_users</code> which holds <code>TwitterUser</code> objects as values. I want those objects to be sorted by the field <code>mentioned</code>. However, using <code>sorted()</code> does not work as I expect. I provide a <code>lambda</code> function that is supposed to determine if user <code>a</code> or user <code>b</code> was mentioned more often.</p>
  
  <pre><code>srt = sorted(twitter_users.values(), 
           cmp=(lambda a,b: 
                True if a.mentioned &gt; b.mentioned else False))
  
  for s in srt:
      print s.mentioned
  </code></pre>
  
  <p>Unfortunately this is not working and the list <code>srt</code> isn't sorted in any way.</p>
  
  <p>How can I make this work?</p>