]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-73991: Add `pathlib.Path.move()` (#122073)
authorBarney Gale <barney.gale@gmail.com>
Sun, 25 Aug 2024 15:51:51 +0000 (16:51 +0100)
committerGitHub <noreply@github.com>
Sun, 25 Aug 2024 15:51:51 +0000 (16:51 +0100)
commit625d0705b9ab348f85853ed73b796763b70154a5
tree40e40aa79d09b2ad39ed7cb4b5efb34ed20e20b5
parentaa905925e1a0120e59e4ffe0874fbd098bf47e63
GH-73991: Add `pathlib.Path.move()` (#122073)

Add a `Path.move()` method that moves a file or directory tree, and returns a new `Path` instance pointing to the target.

This method is similar to `shutil.move()`, except that it doesn't accept a *copy_function* argument, and it doesn't check whether the destination is an existing directory.
Doc/library/pathlib.rst
Doc/whatsnew/3.14.rst
Lib/pathlib/_abc.py
Lib/test/test_pathlib/test_pathlib.py
Lib/test/test_pathlib/test_pathlib_abc.py
Misc/NEWS.d/next/Library/2024-07-21-02-00-46.gh-issue-73991.pLxdtJ.rst [new file with mode: 0644]