]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-100479: Add `pathlib.PurePath.with_segments()` (GH-103975)
authorBarney Gale <barney.gale@gmail.com>
Fri, 5 May 2023 19:04:53 +0000 (20:04 +0100)
committerGitHub <noreply@github.com>
Fri, 5 May 2023 19:04:53 +0000 (19:04 +0000)
commitd00d94214971621e6a3541425ee8c8072023ca1a
treee439827cd482073748827bb73c3a46132dee89e1
parent1afe0e0320c6f19418d44d682ad95ba0c689c595
GH-100479: Add `pathlib.PurePath.with_segments()` (GH-103975)

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>
Doc/library/pathlib.rst
Doc/whatsnew/3.12.rst
Lib/pathlib.py
Lib/test/test_pathlib.py
Misc/NEWS.d/next/Library/2023-04-03-22-02-35.gh-issue-100479.kNBjQm.rst [new file with mode: 0644]