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 19, 2024
1 parent 9dd9ac6 commit a47250f
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 @@ -330,17 +330,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 @@ -353,10 +353,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 @@ -369,7 +369,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 a47250f

Please sign in to comment.