[Python-Dev] Re: os.path.commonprefix breakage

Fred L. Drake, Jr. fdrake@beopen.com
Fri, 18 Aug 2000 12:41:35 -0400 (EDT)


Gordon McMillan writes:
 > I don't think commonprefix should be changed, precisely 
 > because it might break apps. I also think it should not live in 
 > os.path, because it is not an abstract path operation. It's just 
 > a string operation. But it's there, so the best I can advise is 
 > not to use it.

  This works.  Let's accept (some variant) or Skip's desired
functionality as os.path.splitprefix(); this avoid breaking existing
code and uses a name that's consistent with the others.  The result
can be (prefix, [list of suffixes]).  Trailing slashes should be
handled so that os.path.join(prefix, suffix) does the "right thing".


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at beopen.com>
BeOpen PythonLabs Team Member