title: Python hash table design
body: <p>I want to implement a hash table in python. On the table a class object will be associated with the key value. The problem is I want to use the key value to find the index of the class and update it (which of course is not a problem). But what can I do if I want to sort the table using a particular value of the class.</p>
  
  <p>For example, let us consider, we have three value: document_id, score and rank. There is a class "document" which consists of "score" and "rank". "document_id" will be the key of the table. </p>
  
  <p>I want to update the "score" of various entries of the table, using the key: "document_id". But when updating of the scores are done, I want to sort the list/table using the score and assign rank value to the "rank" variable based on updated score.</p>
  
  <p>Can someone kindly give me some guideline about how can I proceed? Or maybe I should simply make it a list?  </p>
  
  <p>The maximum number of item of the table might be upto 25000-30000.</p>
  
  <p>Thanks. </p>