Inconsistent overridden method
Zarr version
v3
Installation
sources
Description
These methods of abstract base class Store are non-async:
Child classes LocalStore, LoggingStore, RemoteStore, MemoryStore, ZipStore override these functions as async. Take the example of ZipStore:
Is that on purpose? I think async is part of the method signature and should be added to the base class.
This is intentional but I don't remember all the details. It has to do with how Python does abstract methods for async generators IIRC. If there is a better solution, I'd be happy to see one come forward though.
I'm afraid I don't have much experience with async methods, so I cannot help much.
It's just that:
- I've seen abstract base classes add
asyncto the method definition - and perhaps add an emptyyieldso that linters are happy. See for example https://github.com/microsoft/pyright/discussions/4741. - Some linters complain about the current situation: https://app.deepsource.com/gh/DimitriPapadopoulos/zarr-python/issue/PYL-W0236/occurrences
I could start a PR where I try to add async to the abstract base class methods, so we can see what happens. How does it sound?
Go for it @DimitriPapadopoulos!