[Python-3000] Mini Path object
Mike Orr
sluggoster at gmail.com
Wed Nov 8 03:46:59 CET 2006
On 11/7/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> >>>> .abspath()
> >>>
> >>>I've always thought this was a strange function. To be honest, I'd
> >>>rather explicitly pass in the cwd().
> >>
> >>I use it; it's convenient. The method name could be improved.
>
> It does violate the constraint of the path object being
> restricted to path algebra operations, though, since the
> result depends on the cwd of the process.
What do we do with Path.cwd() then? It also violates the
path-algrebra-only logic. How else will people get the current
directory? We can put it on FSPath, but then it's the only FSPath
method that returns a Path, so you'd be passing FSPath to Path to
FSPath.
> >>Perhaps. There was one guy in the discussion about Noam's path module
> >>who didn't like .expand() at all; he thought it did too many things
> >>implicitly and was thus too magical.
>
> And again, it strays outside the domain of path algebra
> operations.
This is also the same issue. Where do we put the .expand*() methods
if not on Path?
Is there an actual case where calling normpath() would change which
file the path referred to? Any case that's not handled by
(posix|nt|mac)path.normpath itself?
--
Mike Orr <sluggoster at gmail.com>
More information about the Python-3000
mailing list