def __setitem__(self, key, value):
    super(bidict, self).__setitem__(key, value)
self.inverse[value] = key

def __delitem__(self, key):
    del self.inverse[self[key]]
super(bidict, self).__delitem__(key)
Finding key from value in Python dictionary: