title: simplify code using an inverse dictionary in python
body: <p>Consider some mapping <code>my_map</code> that defines the order of some keys, and some dictionary <code>my_dict</code> that maps the same keys into some values:</p>
  <pre><code>my_map = {'x' : 2, 'y' : 0, 'z' : 1}
  my_dict = {'x' : 'foo', 'z' : 'bar', 'y' : 'baz'}
  </code></pre>
  <p>I want to get an ordered list of the values of <code>my_dict</code> using the order defined by <code>my_map</code>. My best approach of getting there is:</p>
  <pre><code>inv_map = {v: k for k, v in my_map.items()}
  ordered_list = [my_dict[k] for k in [inv_map[d] for d in range(len(my_map))]]
  </code></pre>
  <p>Is there a less clunky way of doing the same?</p>