In Py3K, is it still safe to assume that a list of paths will be (enough like) ordinary strings?
I ask because of the various Path object discussions; it wasn't clear that a Path object should be a sequence of (normalized unicode?) characters (rather than path components), that the path would always be normalized or absolute, or even that it would implement the LE (or LT?) comparison operator. -jJ On 8/26/06, jack.diederich <[EMAIL PROTECTED]> wrote: > Author: jack.diederich > Date: Sat Aug 26 20:42:06 2006 > New Revision: 51624 > Added: python/trunk/Lib/genericpath.py > +# Return the longest prefix of all list elements. > +def commonprefix(m): > + "Given a list of pathnames, returns the longest common leading component" > + if not m: return '' > + s1 = min(m) > + s2 = max(m) > + n = min(len(s1), len(s2)) > + for i in xrange(n): > + if s1[i] != s2[i]: > + return s1[:i] > + return s1[:n] _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
