GH-100479: Add pathlib.PurePath.with_segments()#103975
GH-100479: Add pathlib.PurePath.with_segments()#103975barneygale merged 24 commits intopython:mainfrom
pathlib.PurePath.with_segments()#103975Conversation
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
pathlib.PurePath.__newpath__()pathlib.PurePath._newpath_()
AlexWaygood
left a comment
There was a problem hiding this comment.
My personal preference is still for the version with the initializer argument, but it's a weakly held preference, and I think I'm in the minority. This looks good, and you have my approval whichever way you decide to go :)
|
I also find the initializer argument nicer than a method. (But I may be in the minority for style, I have no trouble doing |
pathlib.PurePath._newpath_()pathlib.PurePath.with_segments()
pathlib.PurePath.with_segments()pathlib.PurePath.with_path()
This reverts commit 7f28ed3.
pathlib.PurePath.with_path()pathlib.PurePath.with_segments()
|
FYI, it looks like the wasm32-wasi buildbot doesn't like this change: https://buildbot.python.org/all/#/builders/1046/builds/1922. |
* main: pythongh-99113: Add PyInterpreterConfig.own_gil (pythongh-104204) pythongh-104146: Remove unused var 'parser_body_declarations' from clinic.py (python#104214) pythongh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (pythongh-104205) pythongh-104108: Add the Py_mod_multiple_interpreters Module Def Slot (pythongh-104148) pythongh-99113: Share the GIL via PyInterpreterState.ceval.gil (pythongh-104203) pythonGH-100479: Add `pathlib.PurePath.with_segments()` (pythonGH-103975) pythongh-69152: Add _proxy_response_headers attribute to HTTPConnection (python#26152) pythongh-103533: Use PEP 669 APIs for cprofile (pythonGH-103534) pythonGH-96803: Add three C-API functions to make _PyInterpreterFrame less opaque for users of PEP 523. (pythonGH-96849)
) Add `pathlib.PurePath.with_segments()`, which creates a path object from arguments. This method is called whenever a derivative path is created, such as from `pathlib.PurePath.parent`. Subclasses may override this method to share information between path objects. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Add
pathlib.PurePath.with_segments(), which creates a path object from arguments. This method is called whenever a derivative path is created, such as frompathlib.PurePath.parent. Subclasses may override this method to share information between path objects.Alternative to #100481.