os.path.commonprefix inadequacies

Skip Montanaro skip at pobox.com
Tue Jul 31 17:59:22 EDT 2001


    Dean> The os.path.commonprefix function at first glance seems like a
    Dean> useful function: to find a common ancestor of a bunch of
    Dean> paths.

I tried to get this sort of change adopted two years ago, but was unable to
convince people that it should operate on path elements instead of strings.
In fact, I actually updated the relevant bits of code in CVS but had to
retract the changes when the semantic change broke something of Mark
Hammond's.  My argument was that the common filesystem prefix of these two
paths

    /home/sally
    /home/sam

should be "/home/" (or "/home"), not "/home/sa".  You can browse the
python-dev archives for August 1999 to read all the details:

    http://mail.python.org/pipermail/python-dev/1999-August/thread.html

Search for "commonprefix".

-- 
Skip Montanaro (skip at pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list