PRE-PEP: new Path class

Peter Hansen peter at engcorp.com
Thu Jan 8 10:09:49 EST 2004


Gerrit Holl wrote:
> 
> Michael Chermside wrote:
> > I agree... paths should be immutable.
> >
> > Instead of .normalize_inplace() which changes the behavior of the
> > Path, how about .get_normalized_string() (please find a better name)
> > which allows access to the normalized version without mutating the
> > Path object? (Or perhaps it should be .get_normalized_Path()... I'm
> > not sure.)
> 
> If we make it immutable, we can simply do path.normalize(), which
> returns the normalized path. Or am I overlooking something?

I haven't been following (either discussion) closely, but this sounds similar 
to some posts I read about a discussing involved a .reverse() method, and
the apparent conclusion that .reversed() [note the 'd'] was more appropriate
as it didn't imply that the object was being modified in-place, but that
it was returning a reversed version of itself.  Same thing could apply here...

-Peter



More information about the Python-list mailing list