[Python-3000] path in py3K Re: [Python-checkins] r51624 (original) (raw)
[Python-3000] path in py3K Re: [Python-checkins] r51624 - in python/trunk/Lib: genericpath.py macpath.py ntpath.py os2emxpath.py posixpath.py test/test_genericpath.py
Guido van Rossum guido at python.org
Sun Aug 27 05:01:27 CEST 2006
- Previous message: [Python-3000] path in py3K Re: [Python-checkins] r51624 - in python/trunk/Lib: genericpath.py macpath.py ntpath.py os2emxpath.py posixpath.py test/test_genericpath.py
- Next message: [Python-3000] Making more effective use of slice objects in Py3k
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
It is not my intention to adopt the Path module in Py3k.
On 8/26/06, Jim Jewett <jimjjewett at gmail.com> wrote:
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 <python-checkins at python.org> 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 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/)
- Previous message: [Python-3000] path in py3K Re: [Python-checkins] r51624 - in python/trunk/Lib: genericpath.py macpath.py ntpath.py os2emxpath.py posixpath.py test/test_genericpath.py
- Next message: [Python-3000] Making more effective use of slice objects in Py3k
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]