title: Python 3.5 OrderedDict: applying sorted to a nested dictionary iterator
body: <p>So the python documentation suggests using <code>itemgetter</code>, <code>attrgetter</code>, or <code>methodgetter</code> from the <code>operator</code> module when applying <code>sorted</code> on complex data types. Further, <code>iterators</code> are smaller and faster than lists for large size objects. </p>
  
  <p>Thus I am wondering how to create an <code>iterator</code> on an <code>OrderDict</code>'s <em>values</em>. The reason being that in the <code>OrderDict</code> I wish to sort all the values are also (regular) dictionaries. </p>
  
  <p>For regular dictionaries, one could do this with:</p>
  
  <pre><code>sorted(my_dict.itervalues(), key=itemgetter('my_key'))
  </code></pre>
  
  <p>however <code>OrderedDict</code> only seems to have the method <code>__iter__()</code> which works on the <code>OrderedDict</code> keys. </p>
  
  <p>So how can I efficiently make an iterator for the values of the <code>OrderedDict</code>.</p>
  
  <p>Note, I am not looking for list comprehension, a lambda function, or extracting the relevant sub key (key inside the dictionary (a value)) values of the <code>OrderedDict</code>. </p>
  
  <p>e.g. </p>
  
  <pre><code>sorted (my_dict, key= lambda key: my_dict[key]['my_key'])
  </code></pre>
  
  <p>example nested:</p>
  
  <pre><code>test = OrderedDict({'a': {'x':1, 'y':2, 'z':3}, 
                      'b': {'x':1, 'y':2, 'z':3}
                      })
  </code></pre>