PEP on path module for standard library

Daniel Dittmar daniel.dittmar at sap.corp
Mon Jul 25 04:59:14 EDT 2005


Terry Reedy wrote:
> for dir in pathobject:
>   if isdir(dir): cd(dir)
> 
> *is*, in essence, what the OS mainly does with paths (after splitting the 
> string representation into pieces).

That's why there is rarely a need to to it in Python code.

> Directory walks also work with paths as sequences (stacks, in particular).

I'd say it works with stacks of pathes, not with stacks of path elements.

I'm not saying that there isn't any use for having a list of path 
elements. But it isn't that common, so it should get an methodname to 
make it more explicit.

Daniel



More information about the Python-list mailing list