GH-125413: `pathlib.Path.copy()`: get common metadata keys only once by barneygale · Pull Request #125990 · python/cpython
barneygale
… once
Improve `pathlib._abc.PathBase.copy()` (which provides `Path.copy()`) by
fetching operands' supported metadata keys up-front, rather than once for
each path in the tree.
This prepares the way for using `os.DirEntry` objects in `copy()`.