PEP on path module for standard library

Peter Hansen peter at engcorp.com
Fri Jul 22 08:47:49 EDT 2005


Reinhold Birkenfeld wrote:
> Michael Hoffman wrote:
>>What do you gain from removing these methods? A smaller dir()?
> 
> It made sense to me at the time I changed this, although at the moment
> I can't exactly recall the reasons.

Along with some of the others (and as a fairly heavy user of "path"), I 
would caution strongly against jumping to do make this change.

Given that a strong part of the justification for path's inclusion in 
the standard library (as expressed here in the past) is that it is 
stable and widely used, making such a fundamental change at this late 
stage just prior to its possible acceptance seems to me very risky.

I have noticed in a number of cases where a "path" was usable as a 
drop-in replacement for strings that previously contained paths.  I 
can't say for sure, but I strongly suspect some of that could would be 
broken if "paths" weren't basestrings.  I'll attempt to check in my own 
code.

Even if those uses don't actually break, it can *also* be useful to have 
the string methods available on a path object, so I'm also uncertain 
what you gain by removing that connection, though it's clear what things 
you might be losing.

-2 for this idea.

-Peter



More information about the Python-list mailing list