title: Converting a dict into a OrderedDict
body: <p>I have a hashtable and a lambda for sort like this:</p>
  
  <pre><code> h = {"hlllleleo": 9, "hello": 5, "fgfgggf" : 7, "abcdefgh": 8}
   lbda = lambda x : h[x]
   from collections import OrderedDict as od
   od({x:h[x] for x in sorted(h, key=lbda)})
   #Outputs:
   OrderedDict([('abcdefgh', 8), ('hlllleleo', 9), ('fgfgggf', 7), 
   ('hello', 5)])
  </code></pre>
  
  <p>Why is the ordered dict not coming out sorted as it is built? If I loop over sorted() it is sorted:</p>
  
  <pre><code> for x in sorted(h, key=lbda):
     print x, h[x]
  
   # Outputs:
   hello 5
   fgfgggf 7
   abcdefgh 8
   hlllleleo 9
  </code></pre>