Skip to content

Commit

Permalink
Merge pull request #75 from NeurodataWithoutBorders/add_contains
Browse files Browse the repository at this point in the history
Implement `LindiReferenceFileSystemStore.__contains__`
  • Loading branch information
magland authored May 28, 2024
2 parents 5922b4f + 4fdab5f commit ac9b6f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lindi/LindiH5pyFile/LindiReferenceFileSystemStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ def __init__(self, rfs: dict, *, mode: Literal["r", "r+"] = "r+", local_cache: U
self.local_cache = local_cache

# These methods are overridden from MutableMapping
def __contains__(self, key: str):
return key in self.rfs["refs"]

def __getitem__(self, key: str):
if key not in self.rfs["refs"]:
raise KeyError(key)
Expand Down

0 comments on commit ac9b6f7

Please sign in to comment.