[Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

Petr Viktorin encukou at gmail.com
Mon Mar 19 05:10:40 EDT 2018


On 03/19/18 09:17, Stephen J. Turnbull wrote:
> Nathaniel Smith writes:
>   > Similarly, it's hard to explain why we have Path.mkdir but not
>   > Path.makedirs
> 
> So what?  Let's fix that.  As you propose:
> 
>   > (maybe it should be Path.mkdir(include_parents=True)
> > is fine, although that default seems a little risky vs. typos.  I know
> I have confused myself with mkdir -p that way a few (though very few)
> times.  Perhaps Guido would prefer Path.makedirs for this functionality.

This is already there as Path.mkdir(parents=True).



More information about the Python-ideas mailing list