title: python sort list based on key sorted list
body: <p>I have a predefined list which indicates the order of some values:</p>
  
  <pre><code>['id','name','age','height','weight',]
  </code></pre>
  
  <p>(can be very long)</p>
  
  <p>I want to sort any subset of this list: </p>
  
  <p>So if i get <code>['height','id']</code> It will become <code>['id','height']</code></p>
  
  <p>or <code>['name','weight','height']</code> ---> <code>['name','height','weight']</code></p>
  
  <p>Is there some way to do it with the <code>sort</code> function using the <code>key</code> paramter somehow? or should I use a custom method, if so what will be most efficient?</p>