]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-79634: Speed up pathlib globbing by removing `joinpath()` call. (#114623)
authorBarney Gale <barney.gale@gmail.com>
Sat, 27 Jan 2024 19:59:51 +0000 (19:59 +0000)
committerGitHub <noreply@github.com>
Sat, 27 Jan 2024 19:59:51 +0000 (19:59 +0000)
commit823a38a960c245cbf309ef29120d3690ba1bcd2c
tree71d67154b8df245aa6256a2fb45a20254f743048
parent7a470541e2bbc6f3e87a6d813e2ec42cf726de7a
GH-79634: Speed up pathlib globbing by removing `joinpath()` call. (#114623)

Remove `self.joinpath('')` call that should have been removed in 6313cdde.

This makes `PathBase.glob('')` yield itself *without* adding a trailing slash. It's hard to say whether this is more or less correct, but at least everything else is faster, and there's no behaviour change in the public classes where empty glob patterns are disallowed.
Lib/pathlib/_abc.py
Lib/test/test_pathlib/test_pathlib.py
Lib/test/test_pathlib/test_pathlib_abc.py