Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(49708)

Unified Diff: Doc/library/os.path.rst

Issue 4755: Common path prefix
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Lib/genericpath.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Doc/library/os.path.rst
===================================================================
--- Doc/library/os.path.rst (revision 67929)
+++ Doc/library/os.path.rst (working copy)
@@ -53,6 +53,16 @@
Note that this may return invalid paths because it works a character at a time.
+.. function:: commonpathprefix(list, separator=None)
techtonik 2012/05/23 10:25:38 .. function:: commonpath(list, separator=os.sep)
+
+ Return the longest path prefix (taken component-by-component) that is a
+ prefix of all paths in *list*. If *list* is empty, return the empty
+ string (``''``). Unlike :func:`commonprefix`, this will only return the
+ empty string or complete paths. The optional second argument defaults to
+ os.sep on platforms other than Windows and OS/2. On those platforms it
+ defaults to either os.sep or os.altsep.
techtonik 2012/05/23 10:25:38 Return the longest common path for all paths in *l
+
+
.. function:: dirname(path)
Return the directory name of pathname *path*. This is the first half of the
« no previous file with comments | « no previous file | Lib/genericpath.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+