-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
User-defined virtual path objects #110109
Copy link
Copy link
Closed
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancementA feature request or enhancement
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
Done
Proposal
Add a
PathBaseclass that can be subclassed by users to implement "virtual paths", e.g. paths within.zipfiles or on FTP servers, and publish it as an external PyPI package.Phase 1: Private support in pathlib
_PathBaseclasspathlib._PathBase#106337WalkTestsintoDummyPathTestpathlib.Path.walk()into main test classes. #110655__hash__(),__eq__, etc - we shouldn't inherit thePurePathimplementationpathlib.PurePathmethods #112012pathlib._PurePathBase#110670glob.translate()function #106703from_uri()classmethodpathlib.Path.from_uri()classmethod. #107640Phase 2: Experimental support in PyPI package
pathlib._abcpathlib._abcmodule. #112881pathmod, if anyPrevious Discussion
https://discuss.python.org/t/make-pathlib-extensible/3428
Linked PRs
from_uri()andas_uri()together. #110312pathlib._PathBase.resolve()#110412pathlib.Path.walk()into main test classes. #110655pathlib._PurePathBase#110670pathlib.PurePathmethods #112012pathlib.WindowsPath.owner()andgroup()#112239pathlib.Pathuser subclasses #112242pathlib._abcmodule. #112881pathlibis a package #112901pathlib._abc. #113292pathlib._abc.PurePathBaserepr #113376test_pathlib_abcimports to ease backporting #113411io.text_encoding()#113417warnings._deprecated()#113419