Add methods that invoke shutil functions

Python newcomers are often baffled by the os / os.path / shutil trifurcation because an intimate knowledge of POSIX is necessary to understand why copying a file is a synthetic user-land operation while removing a file is an atomic operating-system-level command. The pathlib library could remove this confusion once and for all by adding shutil-methods to its objects, putting operations like "copy" alongside semantically equivalent operations like removing a file.

Comments (5)

That's part of the plan indeed. One possible annoyance is the asymmetry of method calls, i.e. instead of doing shutil.copy(src, dest) you would be doing src.copy(dest). But we can probably live with it.

Any updates on the plan? Is there any work being done or specific design guidelines (assuming you'd let someone else do this)?

Hi,

On a methodological standpoint, pathlib is now developed in the Python standard library. This backport (the bitbucket project) will at best only receive bug fixes. So I would recommend creating an issue on https://bugs.python.org/

About the feature request itself, I'm very much open to it, although this will probably require some API discussions. These should happen either on the Python bug tracker, or on the python-dev mailing-list (IMHO). And, yes, I do welcome patches as well.