Skip to content

Commit f6c7fd4

Browse files
committed
Use DirectoryStore.__eq__ in NestedDirectoryStore
Instead of trying to implement a custom `__eq__` for `NestedDirectoryStore`, fallback to the `DirectoryStore` implementation once we have verified they are the same type.
1 parent d425945 commit f6c7fd4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎zarr/storage.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,10 +1005,10 @@ def __contains__(self, key):
10051005
return super(NestedDirectoryStore, self).__contains__(key)
10061006

10071007
def __eq__(self, other):
1008-
return (
1009-
isinstance(other, NestedDirectoryStore) and
1010-
self.path == other.path
1011-
)
1008+
if not isinstance(other, NestedDirectoryStore):
1009+
return False
1010+
else:
1011+
return super(NestedDirectoryStore, self).__eq__(other)
10121012

10131013
def listdir(self, path=None):
10141014
children = super(NestedDirectoryStore, self).listdir(path=path)

0 commit comments

Comments
 (0)