Filename type (Was: Re: finding file size)

Gerrit Holl gerrit at nl.linux.org
Sun Jan 4 03:52:55 EST 2004


[Peter Otten]
> >>I think both filename class and os.path functions can peacefully coexist.

[Gerrit Holl (me)]
> >Thanks for the links.
> >(I think they don't, by the way)

[Mike C. Fletcher]
> 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.

Sure, I don't think os.path would die soon, it will surely take longer
than the string module to die. But I think there is a number of places
where Python could be more object-oriented than it is, and this is one
of them. The first step in making those modules more object-oriented is
providing a OO-alternative: the second step is deprecating the old way,
and the third step is providing only the OO-way. The third step will
surely not be made until Python 3.0.

The string module has made the first two steps. In my view, the time
module has made the first step, although I'm not sure whether that's
true. I would like to see a datetime module that makes the time module
totally reduntant, because I never liked the time module: it doesn't fit
into my brain properly, because it's not object oriented. Now, I try to
use the datetime module whenever I can, but something like strptime
isn't there. PEP 321 solves this, so I'd like time to become eventually
deprecated after something DateUtil-like inclusion as well, but it
probably won't.

Hmm, the Zen of Python is not very clear about this:

Now is better than never.
Although never is often better than *right* now.

...so there must be a difference between 'now' and 'right now' :)

> 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 :) .

Sure :)

yours,
Gerrit.

-- 
147. If she have not borne him children, then her mistress may sell her
for money.
          -- 1780 BC, Hammurabi, Code of Law
-- 
Asperger's Syndrome - a personal approach:
	http://people.nl.linux.org/~gerrit/english/




More information about the Python-list mailing list