You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the / operator as an alias to get_child()
Implement Folder.iterdir()
Folder.get_children() should be rewritten to call return list(self.iterdir())
Resource should inherit PurePath (rather questionable, Resource is not necessarily a Path on the filesystem, it may represent a file in a zipfile module)
The purpose here is not to make Resource usable in contexts where Path is expected, but rather simply just to standardize the vocabularies of path operations.
There is no plan to make Resource implement the entire pathlib interface; most of it doesn't make sense for rope's purpose and would only make using Resource class unnecessarily confusing (e.g. is_block_device() would never make sense for rope). If you need a real pathlib object, then access the Resource.pathlib property or convert the pathlib.Path(resource) which would use __fspath__ interface.
The text was updated successfully, but these errors were encountered:
What needed to be changed to make
Resource
,File
, andFolder
implement apathlib
-like interface:Resource
should implementos.PathLike
Implement os.PathLike on Resource #738File.read()
should be deprecated, renamed toFile.read_text()
File.write()
should be deprecated,File.write_text()
andFile.write_bytes()
should be implementedFile.is_folder()
andFolder.is_folder()
should be deprecated, renamed to.is_dir()
(done in Implement os.PathLike on Resource #738)Resource.is_file()
/
operator as an alias toget_child()
Folder.iterdir()
Folder.get_children()
should be rewritten to callreturn list(self.iterdir())
Resource
should inheritPurePath
(rather questionable, Resource is not necessarily a Path on the filesystem, it may represent a file in a zipfile module)The purpose here is not to make Resource usable in contexts where Path is expected, but rather simply just to standardize the vocabularies of path operations.
There is no plan to make
Resource
implement the entirepathlib
interface; most of it doesn't make sense for rope's purpose and would only make usingResource
class unnecessarily confusing (e.g.is_block_device()
would never make sense for rope). If you need a real pathlib object, then access theResource.pathlib
property or convert thepathlib.Path(resource)
which would use__fspath__
interface.The text was updated successfully, but these errors were encountered: