title: Python secondary sorting list of index, key from multiple lists
body: <p>I am trying to perform a secondary sorting with <code>list.sort()</code>, and here is my code:</p>
  
  <pre><code>index_list = list(range(12))
  a_list = [5, 5, 5, 1, 2, 3, 3, 3, 3, 8, 8, 10]
  b_list = [1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 10]
  
  index_list.sort(key=lambda x:(a_list[x], b_list[x]))
  print(index_list)
  </code></pre>
  
  <p>The result was <code>[3, 4, 5, 6, 7, 8, 0, 1, 2, 9, 10, 11]</code>, while I expected the last three items to be <code>[..., 10, 9, 11]</code>.</p>
  
  <p>I thought it should do secondary sorting (based on the value of <code>b_list</code>), but seems that it didn't.</p>
  
  <hr>
  
  <p>EDIT: typo fixed.</p>