[Python-3000] cleaning up *path.py code duplication
Jack Diederich
jackdied at jackdied.com
Sat Aug 26 03:52:43 CEST 2006
Ooph, there is some dissonance in the comments and the code. Cut-n-paste
errors I suppose.
-- ntpath.py --
def islink(path):
"""Test for symbolic link. On WindowsNT/95 always returns false"""
return False
<snip 10 lines>
# This follows symbolic links, so both islink() and isdir() can be true
# for the same path.
def isfile(path):
"""Test whether a path is a regular file"""
-- end exeprt --
I'll try and keep a list so those in the know can do a post mortem on the
comments. I'm only useful for vetting the *nix versions.
-Jack
On Fri, Aug 25, 2006 at 05:35:33PM -0700, Guido van Rossum wrote:
> Sounds like a great 2.6 project. Beware of things that are
> intentionally different between platforms of course!
>
> --Guido
>
> On 8/25/06, Jack Diederich <jackdied at jackdied.com> wrote:
> > While checking find() uses in the stdlib I noticed that the various
> > path modules have duplicate code and docstrings for some generic path
> > manipulations. Delightfully they even have different implementations
> > and docstrings for identical functions. splitext() is a great bad
> > example - os2emxpath.splitext() builds up strings by doing char-by-char
> > concatenations where everyone else uses find() + slice.
> >
> > If there are no objections I'll move these into a module named
> > genericpath.py and change the others to do
> >
> > from genericpath import func1, func2, funcN
> >
> > where applicable.
> >
> > So, any objections? Should it be a 2.6 backport too?
> >
> > -Jack
> > _______________________________________________
> > Python-3000 mailing list
> > Python-3000 at python.org
> > http://mail.python.org/mailman/listinfo/python-3000
> > Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org
> >
>
>
> --
> --Guido van Rossum (home page: http://www.python.org/~guido/)
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/jack%40performancedrivers.com
>
More information about the Python-3000
mailing list