PEP on path module for standard library

Michael Hoffman cam.ac.uk at mh391.invalid
Fri Jul 22 13:29:21 EDT 2005


John Roth wrote:

> However, a path as a sequence of characters has even less
> meaning - I can't think of a use, while I have an application
> where traversing a path as a sequence of path elements makes
> perfect sense: I need to descend the directory structure, directory
> by directory, looking for specific files and types.

I *have* used a path as a sequence of characters before. I had to deal 
with a bunch of filenames that were formatted like "file_02832.a.txt"

I can see the case for a path as a sequence of elements, although in 
practice, drive letters, extensions, and alternate streams complicate 
things.

But as the discussion here unfolds I'm starting to feel that the 
advantages of using a possibly more "meaningful" approach to path as a 
sequence of elements are overwhelmed by the practical advantages of 
using a basestring. Mainly, that you can use it anywhere a basestring 
would be used today and it Just Works.
-- 
Michael Hoffman



More information about the Python-list mailing list