filesystem_spec
filesystem_spec copied to clipboard
Don't type `protocol` as `ClassVar`
Protocol is defined as a ClassVar:
https://github.com/fsspec/filesystem_spec/blob/ffdfed146f070cd05bce78767fc9873d165c59fd/fsspec/spec.py#L109
This means that pylance gives me an error when I try to set it in a constructor:
Typing protocol as a ClassVar makes sense if you assume that you have separate, concrete classes for each implementation, but this is not always true. In Obstore, we have one class (FsspecStore) which dynamically supports different protocols based on the type of obstore.store used inside it.