class Foo(dict):

    def __init__(self, transform, *args, **kwargs):
        super(Foo, self).__init__(self, *args, **kwargs)
assert isfunction(transform), 'Transform argument must be a function.'
self._transform = transform

def get(self, k, d=None):
    return super(Foo, self).get(self._transform(k), d)

def __getitem__(self, item):
    return super(Foo, self).__getitem__(self._transform(item))

def __contains__(self, item):
    return super(Foo, self).__contains__(self._transform(item))

def __repr__(self):
    return '<Foo instance {}>'.format(id(self))
Класс, похожий на диктофон, который использует преобразованные ключи.