[issue33498] pathlib.Path wants an rmtree method

Charles Machalow report at bugs.python.org
Sun Jun 14 03:48:31 EDT 2020


Charles Machalow <csm10495 at gmail.com> added the comment:

I'm disappointed to see this closed. For new (and old) users, it makes complete sense to have an rmtree method on the Path object itself.

If I'm using pathlib, I try not to delegate to os.<things> for file operations, since it also tends to seem more OO and clean to stick with the object methods. Same thought process for shutil for rmtree.

We already have things like owner() and group() that explicitly go import grp, pwd to do their job on Path objects. Why is shutil special with regards to using another piece of the standard library from pathlib? To me this request falls in the same boat as those functions; they were likely added for convenience and since it made sense.

I believe the very same holds true for the request to add rmtree().

----------
nosy: +Charles Machalow

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33498>
_______________________________________


More information about the Python-bugs-list mailing list