class RangeDict(dict):


    class AmbiguityException(Exception):
        pass

def __getitem__(self, key):
    hits = [(a, b) for a, b in list(self.keys()) if a <= key < b]
if not hits:
    {}[key]
if len(hits) > 1:
    pass
3 dimensional dictionary