Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/zarr/abc/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,20 @@ def _check_writable(self) -> None:
if self.read_only:
raise ValueError("store was opened in read-only mode and does not support writing")

def _check_value(self, value: object) -> None:
"""Raise a TypeError if ``value`` is not a Buffer instance.

The error message is prefixed with the concrete store class name, e.g.
``MemoryStore.set(): ...``, so that callers do not have to repeat it.
"""
from zarr.core.buffer import Buffer

if not isinstance(value, Buffer):
raise TypeError(
f"{type(self).__name__}.set(): `value` must be a Buffer instance. "
f"Got an instance of {type(value)} instead."
)

@abstractmethod
def __eq__(self, value: object) -> bool:
"""Equality comparison."""
Expand Down
Loading
Loading