Skip to content

Commit

Permalink
Make methods of abstract base class async
Browse files Browse the repository at this point in the history
The rationale is that the methods of child classes should match the
signatures of the methods of the abstract base class, including async.
  • Loading branch information
DimitriPapadopoulos committed Oct 16, 2024
1 parent 1131253 commit 52e66c9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/zarr/abc/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,17 +329,17 @@ def supports_listing(self) -> bool:
...

@abstractmethod
def list(self) -> AsyncGenerator[str, None]:
async def list(self) -> AsyncGenerator[str, None]:
"""Retrieve all keys in the store.
Returns
-------
AsyncGenerator[str, None]
"""
...
yield ""

@abstractmethod
def list_prefix(self, prefix: str) -> AsyncGenerator[str, None]:
async def list_prefix(self, prefix: str) -> AsyncGenerator[str, None]:
"""
Retrieve all keys in the store that begin with a given prefix. Keys are returned with the
common leading prefix removed.
Expand All @@ -352,10 +352,10 @@ def list_prefix(self, prefix: str) -> AsyncGenerator[str, None]:
-------
AsyncGenerator[str, None]
"""
...
yield ""

@abstractmethod
def list_dir(self, prefix: str) -> AsyncGenerator[str, None]:
async def list_dir(self, prefix: str) -> AsyncGenerator[str, None]:
"""
Retrieve all keys and prefixes with a given prefix and which do not contain the character
“/” after the given prefix.
Expand All @@ -368,7 +368,7 @@ def list_dir(self, prefix: str) -> AsyncGenerator[str, None]:
-------
AsyncGenerator[str, None]
"""
...
yield ""

def close(self) -> None:
"""Close the store."""
Expand Down

0 comments on commit 52e66c9

Please sign in to comment.