Filename type (Was: Re: finding file size)

Mike C. Fletcher mcfletch at
Sat Jan 3 23:23:41 CET 2004

Gerrit Holl wrote:

>Peter Otten wrote:
>>has an implementation of your proposal by Mike C. Fletcher. I think both
>>filename class and os.path functions can peacefully coexist.
>Thanks for the links.
>(I think they don't, by the way)
You hawks, always seeing war where we see peace :) ;) . 

Seriously, though, a path type would eventually have ~ the same relation 
as the str type now does to the string module.  Initial implementations 
of a path type are going to use the os.path stuff, but to avoid code 
duplication, the os.path module would eventually become a set of trivial 
wrappers that dispatch on their first argument's method(s) (after 
coercian to path type).

Is that peaceful?  I don't know.  If there's a war, let's be honest, 
os.path is going to take a good long while to defeat because it's there 
and embedded directly into thousands upon thousands of scripts and 
applications.  We can fight a decent campaign, making a common module, 
then getting it blessed into a standard module, encouraging newbies to 
shun the dark old os.path way, encouraging maintainers to use the new 
module throughout their code-base, etceteras, but os.path is going to 
survive a good long while, and I'd imagine that being friendly toward it 
would keep a few of our comrades off the floor.

Just as a note, however, we haven't had a *huge* outpouring of glee for 
the current spike-tests/implementations.  So it may be that we need to 
get our own little army in shape before attacking the citadel :) .

Have fun,

  Mike C. Fletcher
  Designer, VR Plumber, Coder

More information about the Python-list mailing list