Skip to content

Commit 136daec

Browse files
implement __eq__ for LocalStore (#1792)
* LocalStore__eq__ #1744 Fix equality comparison in LocalStore class by implementing __eq__ method * Update src/zarr/v3/store/local.py Changed 'LocalStore' to object in __eq__ Co-authored-by: Davis Bennett <[email protected]> --------- Co-authored-by: Davis Bennett <[email protected]>
1 parent a33ebf2 commit 136daec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/zarr/v3/store/local.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ def __str__(self) -> str:
6767
def __repr__(self) -> str:
6868
return f"LocalStore({repr(str(self))})"
6969

70+
def __eq__(self, other: object) -> bool:
71+
return isinstance(other, type(self)) and self.root == other.root
72+
7073
async def get(
7174
self, key: str, byte_range: Optional[Tuple[int, Optional[int]]] = None
7275
) -> Optional[bytes]:

0 commit comments

Comments
 (0)