def __len__(self):
    return len(self.__data)

def __iter__(self):
    return iter(self.__data)

def __setitem__(self, k, v):
    if k not in self.__data:
        raise KeyError(k)
self.__data[k] = v

def __delitem__(self, k):
    raise NotImplementedError

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

def __contains__(self, k):
    return k in self.__data
Define a python dictionary with immutable keys but mutable values