Some renames that might make the API clearer:
_Accessor→AbstractFileSystem_NormalAccessor→LocalFileSystem
I’d suggest both AbstractFileSystem and LocalFileSystem gets a __new__ method that prevents direct instantiation (subclass + instantiate would be fine) to guard against direct usage, per @pitrou
The key question for me is:
I have this
FileSystemobject stored in amyfsvariable, how can I get aPathtype that uses it?
I personally haven’t come up with anything good here. Options include:
- Leave it entirely up to the user or library to construct a
Pathtype with theirFileSysteminstance attached myfs.Path(...)-Pathis an attribute that stores a subclass ofpathlib.Pathwith our FS instance bound.pathlib.make_path_type(myfs)pathlib.Path(..., fs=myfs)- Do away with
FileSystem(i.e. accessors) altogether, and merge their methods intoPath? - Something else?
Thanks!