def __getitem__(self, key):
    result = self._get_indexed_value(key, error_type=KeyError)
    self.__dict__[key] = result
    return result
def __getitem__(self, key):
    result = self._get_indexed_value(key, error_type=KeyError)
    self.__dict__[key] = result
    return result