| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
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.
| Back | FazBrowse Home | New Git URL |
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.
📚 Documentation preview 📚: https://cpython-previews--123314.org.readthedocs.build/