title: How to implement an efficient bidirectional hash table?
body: <p>Python <code>dict</code> is a very useful data-structure:</p>
  
  <pre><code>d = {'a': 1, 'b': 2}
  
  d['a'] # get 1
  </code></pre>
  
  <p>Sometimes you'd also like to index by values.</p>
  
  <pre><code>d[1] # get 'a'
  </code></pre>
  
  <p>Which is the most efficient way to implement this data-structure? Any official recommend way to do it?</p>