Serhiy Storchaka added the comment:
Concur with Karthikeyan.
pathlib.Path provides an object oriented interface to file path operations and
to low-level filesystem operations. rmtree() is a high-level and complex
operation. Instead of adding more and more complex operations to the Path class
Karthikeyan Singaravelan added the comment:
There is shutil.rmtree that accepts path objects and is more high level. From
the previous discussions with respect to expanding API it's recommended to
change the functions already present to accept path objects which shutil.rmtree
already does an
New submission from Alori :
pathlib.Path supports deletion of both files (Path.unlink()) and directories
(Path.rmdir()).
Unfortunately, Path.rmdir() does not allow deletion of non-empty directories
which means users must use shutil.rmtree() when deleting such paths.
Since pathlib.Path alread