On 10/18/22, Todd <toddr...@gmail.com> wrote:
>
> So I think it would make a lot of sense to include copying inside pathlib.
> I propose adding a `copy` method to `pathlib.Path` (for concrete paths).
>
> The specific call signature would be:
>
> copy(dst, *, follow_symlinks=True, recursive=True, dir_exist_ok=True)
>
> This will call `shutil.copytree` for directories if recursive is True, or
> `copy2` if recursive if False. For files it will call `copy2` always.

FYI, Barney Gale also proposed implementing copy() and copytree()
methods recently. Barney is working on a significant restructuring of
pathlib.

https://discuss.python.org/t/incrementally-move-high-level-path-operations-from-shutil-to-pathlib/19208
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/VLZ52HC6625KYESUHP6UNLUAD4FIXZC4/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to