# Feature or enhancement This issue covers the final tasks needed to make the pathlib ABCs worthy of using in `zipfile.Path` (i.e. `zipp.Path`). # Tasks - [x] Rename `PurePathBase` to `JoinablePath`, and split `PathBase` into `ReadablePath` and `WritablePath` - https://github.com/python/cpython/pull/128523 - [x] Make `WritablePath` a sibling (not subclass) of `ReadablePath` - https://github.com/python/cpython/pull/129014 - [x] Add `ReadablePath.info` - https://github.com/python/cpython/pull/127730 - [x] Subclass `abc.ABC` from `JoinablePath`, and make `parser` abstract - https://github.com/python/cpython/pull/128745 - [x] Make type-checking more consistent - https://github.com/python/cpython/pull/130199 - [x] Move metadata reading into `ReadablePath.info`; remove `ReadablePath._copy_reader` - https://github.com/python/cpython/pull/129897 - [x] Move metadata writing into `WritablePath._write_info()`; remove `WritablePath._copy_writer` - https://github.com/python/cpython/pull/130238 - [x] Merge `pathlib._abc` into `pathlib.types` - https://github.com/python/cpython/pull/130747 - https://github.com/python/cpython/pull/130748 - [x] Tests: replace the `Dummy*` classes with simple `zipfile.Path`-like implementation - https://github.com/python/cpython/pull/131018 - [x] Tests: add tests for `WritablePath` - https://github.com/python/cpython/pull/131112 - [x] Tests: parametrize `copy()` tests - https://github.com/python/cpython/pull/131168 - [x] Finalise `copy()` implementation - https://github.com/python/cpython/pull/131259 - [ ] Add type annotations? - [x] Sync code to pathlib-abc PyPI package - https://github.com/python/cpython/pull/131315 - [x] Update pathlib-abc documentation - [x] Publish new version of pathlib-abc - [ ] Merge PR to jaraco/zipp - https://github.com/jaraco/zipp/pull/132 Discussion: https://discuss.python.org/t/make-pathlib-extensible/3428 <!-- gh-linked-prs --> ### Linked PRs * gh-128523 * gh-128745 * gh-129014 * gh-129841 * gh-130199 * gh-130747 * gh-130748 * gh-130964 * gh-131315 * gh-127343 * gh-131617 * gh-131621 * gh-133051 * gh-133105 * gh-133437 * gh-134101 * gh-134104 <!-- /gh-linked-prs -->
Feature or enhancement
This issue covers the final tasks needed to make the pathlib ABCs worthy of using in
zipfile.Path(i.e.zipp.Path).Tasks
PurePathBasetoJoinablePath, and splitPathBaseintoReadablePathandWritablePathWritablePatha sibling (not subclass) ofReadablePathpathlib._abc.WritablePatha sibling ofReadablePath#129014ReadablePath.infopathlib.Path.infoattribute #127730abc.ABCfromJoinablePath, and makeparserabstractabc.ABCinpathlib._abc#128745ReadablePath.info; removeReadablePath._copy_readerpathlib.Path.info#129897WritablePath._write_info(); removeWritablePath._copy_writerpathlib.Pathmethod to write metadata #130238pathlib._abcintopathlib.typespathlib._abcintopathlib.types#130747pathlib._localintopathlib#130748Dummy*classes with simplezipfile.Path-like implementationWritablePathcopy()testscopy()implementationpathlib-abcjaraco/zipp#132Discussion: https://discuss.python.org/t/make-pathlib-extensible/3428
Linked PRs
abc.ABCinpathlib._abc#128745pathlib._abc.WritablePatha sibling ofReadablePath#129014pathlib.types.PathInfowhen copying #129841pathlib._abcintopathlib.types#130747pathlib._localintopathlib#130748with_name()handling of empty names #130964ReadablePath.glob()#127343magic_open()arguments #131617JoinablePath.__vfspath__()#133437