Feature or enhancement
Proposal:
I propose we add a pathlib.Path.metadata() method that requires a keyword-only cached argument, e.g.:
>>> m = pathlib.Path('README.txt').metadata(cached=True)
>>> m
Metadata('README.txt')
>>> m.is_file()
True
If cached is True, the method may return a Metadata object that was previously fetched and cached. If False, the return value is always up-to-date.
pathlib.Path.info should be soft-deprecated; its implementation should call self.metadata(cached=True)
Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
https://discuss.python.org/t/ergonomics-of-new-pathlib-path-scandir/71721/70
Feature or enhancement
Proposal:
I propose we add a
pathlib.Path.metadata()method that requires a keyword-only cached argument, e.g.:If cached is
True, the method may return aMetadataobject that was previously fetched and cached. IfFalse, the return value is always up-to-date.pathlib.Path.infoshould be soft-deprecated; its implementation should callself.metadata(cached=True)Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
https://discuss.python.org/t/ergonomics-of-new-pathlib-path-scandir/71721/70