[Python-ideas] Pathlib additions & changes
Chris Angelico
rosuav at gmail.com
Mon Jun 22 16:59:18 CEST 2015
On Mon, Jun 22, 2015 at 6:30 PM, David Townshend <aquavitae69 at gmail.com> wrote:
> 3. There are several other minor irritations where a common pattern
> requires several lines or the use of a lower-level library such as shutil.
> For example:
>
> * Recursively remove a directory (no sane way using pathlib alone)
> shutil.rmtree(str(path))
I'm not sure shutil should be considered a lower-level library. It's a
separate set of tools aimed at shell-like functionality. Removing a
directory tree seems right for shutil; what if shutil.rmtree() would
accept a Path object as an alternative to a str? That'd make
reasonable sense, and it'd feel like the two modules were working well
together.
(Or can it already?)
ChrisA
More information about the Python-ideas
mailing list