> I'm all for breaking backwards compatibility when it allows some genuine > improvements that would otherwise be impossible, but in this particular > case a little API bloat seems like the least of the available evils :)
I don't think any change is necessary. os.path.commonprefix works just fine on path components: py> p = ["/usr/bin/ls", "/usr/bin/ln"] py> os.path.commonprefix([f.split('/') for f in p]) ['', 'usr', 'bin'] py> p.append("/usr/local/bin/ls") py> os.path.commonprefix([f.split('/') for f in p]) ['', 'usr'] Of course, using it that way would require a library function that reliably splits a path into components; I think one would have to do abspath on arbitrary inputs. Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com