title: Access keys in dictionary by object string representation instead of object
body: <p>I have a python dictionary which is keyed by tuples of objects of a specific class:</p>
  
  <pre><code>class MyClass:
  
      def __init__(self, label):
          self.label = label
  
      def __str__(self):
          return self.label
  
      def __repr__(self):
          return self.label
  
  obj1 = MyClass('obj1')
  obj2 = MyClass('obj2')
  obj3 = MyClass('obj3')
  obj4 = MyClass('obj4')
  
  my_dict = {(obj1, obj2): 'foo', (obj3, obj4): 'bar'}
  
  print(my_dict[(obj1, obj2)])
  
  # this should also be possible (string API for dict): 
  # print(my_dict[('obj1', 'obj2')])
  # which works with the following code but seems to be not the best solution
  my_dict2 = {tuple([str(e) for e in k]): v for k, v in my_dict.items()}
  print(my_dict2[('obj1', 'obj2')])
  </code></pre>
  
  <p>Now I want to provide the possibility to access elements by using keys with object string representations e.g. <code>my_dict[('obj1', 'obj2')</code> and I am not sure about how to solve this in a clean and efficient way.</p>
  
  <p>My first and probably obvious idea was to convert all keys to strings e.g. <code>('obj1','obj2')</code> within another dictionary.</p>
  
  <p>But isn't there a more elegant way to provide both access options (keys=objects/strings) on the same dict like overriding the dictionary class and providing additional methods or writing some sort wrapper function? What would be a good way to solve this?</p>
  
  <p>Any help is much appreciated. Thanks in advance!</p>