mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
These two methods accept an *existing* directory path, onto which we join
the source path's base name to form the final target path.
A possible alternative implementation is to check for directories in
`copy()` and `move()` and adjust the target path, which is done in several
`shutil` functions. This behaviour is helpful in a shell context, but
less so in a stored program that explicitly specifies destinations. For
example, a user that calls `Path('foo.py').copy('bar.py')` might not
imagine that `bar.py/foo.py` would be created, but under the alternative
implementation this will happen if `bar.py` is an existing directory.
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_pathlib.py | ||
| test_pathlib_abc.py | ||