def __getitem__(self, k):
    return self.d[k]

def __setitem__(self, k, v):
    if k not in self.d:
        self.L.append(k)
self.sorted = False
self.d[k] = v

def __delitem__(self, k):
    pass
Диктовка по ключу в Python