]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-112361: Speed up pathlib by removing some temporary objects. (#112362)
authorBarney Gale <barney.gale@gmail.com>
Sat, 25 Nov 2023 17:19:38 +0000 (17:19 +0000)
committerGitHub <noreply@github.com>
Sat, 25 Nov 2023 17:19:38 +0000 (17:19 +0000)
commit19a1fc1b3df30f64450d157dc3a5d40c992e347f
tree347f7abd5eb38070f713b2d5f32e1e2a792590d5
parent6b961b8ceaba372b78d03feaceb4837bf7236694
GH-112361: Speed up pathlib by removing some temporary objects. (#112362)

Construct only one new list object (using `list.copy()`) when creating a
new path object with a modified tail. This slightly speeds up
`with_name()` and `with_suffix()`
Lib/pathlib.py
Lib/test/test_pathlib.py
Misc/NEWS.d/next/Library/2023-11-24-09-27-01.gh-issue-112361.kYtnHW.rst [new file with mode: 0644]