def __getitem__(self, key): if key not in self.src: raise errors.invalid_key_error(self, key) if key in self.dst: return self.dst[key] else: value = self.src[key] self.dst.save_item(key, value) return value
def __getitem__(self, key): for d in self._datasets: if key in d: return d[key] raise errors.invalid_key_error(self, key)
def __delitem__(self, key): self._assert_writable('Cannot delete item from unwritable dataset') if key in self._keys: del self._base[key] else: raise errors.invalid_key_error(self, key)
def __setitem__(self, key, value): self._assert_writable('Cannot set item for unwritable dataset') if key in self._keys: self._base[key] = value else: raise errors.invalid_key_error(self, key)
def __getitem__(self, key): self._assert_open('Cannot get item from closed dataset') if key not in self._keys: raise errors.invalid_key_error(self, key) return self._base[key]