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

Greg Ewing greg@cosc.canterbury.ac.nz
2000年8月17日 16:53:05 +1200 (NZST)


Skip:
> Alternatively, how about os.path.suffixes? It would work similar to
> os.path.commonprefix, but instead of returning the prefix of a group of
> files, return a list of the suffixes resulting in the application of the
> common prefix:

To avoid duplication of effort, how about a single function
that does both:
 >>> files = ["/home/swen", "/home/swanson", "/home/jules"]
 >>> os.path.factorize(files)
 ("/home", ["swen", "swanson", "jules"])
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	 | A citizen of NewZealandCorp, a	 |
Christchurch, New Zealand	 | wholly-owned subsidiary of USA Inc. |
greg@cosc.canterbury.ac.nz	 +--------------------------------------+

AltStyle によって変換されたページ (->オリジナル) /