[Python-ideas] PEP 428 - object-oriented filesystem paths

Ethan Furman ethan at stoneleaf.us
Sat Oct 6 23:27:52 CEST 2012


Serhiy Storchaka wrote:
> On 05.10.12 21:25, Antoine Pitrou wrote:
>> PS: You can all admire my ASCII-art skills.
> 
> PurePosixPath and PureNTPath looks closer to Path than to PurePath.
> 
>> The ``parent()`` method returns an ancestor of the path::
> 
> p[:-n] is shorter and looks neater than p.parent(n). Possible the 
> ``parent()`` method is unnecessary?

Sequencing currently operates as an os.listdir, so [:-n] would give the 
last entry of the folder.

Perhaps Path should not have a default iteration, but instead have 
.children, .parents, .parts, etc.

~Ethan~



More information about the Python-ideas mailing list