[Python-checkins] cpython (merge 3.5 -> default): Merge 3.5
yury.selivanov
python-checkins at python.org
Tue Aug 18 06:00:43 CEST 2015
https://hg.python.org/cpython/rev/a8715361180e
changeset: 97427:a8715361180e
parent: 97425:3c94ece57c43
parent: 97426:637a9d6328f6
user: Yury Selivanov <yselivanov at sprymix.com>
date: Mon Aug 17 23:43:54 2015 -0400
summary:
Merge 3.5
files:
Doc/library/os.path.rst | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst
--- a/Doc/library/os.path.rst
+++ b/Doc/library/os.path.rst
@@ -82,8 +82,21 @@
Return the longest path prefix (taken character-by-character) that is a
prefix of all paths in *list*. If *list* is empty, return the empty string
- (``''``). Note that this may return invalid paths because it works a
- character at a time. To obtain a valid path, see :func:`commonpath`.
+ (``''``).
+
+ .. note::
+
+ This function may return invalid paths because it works a
+ character at a time. To obtain a valid path, see
+ :func:`commonpath`.
+
+ ::
+
+ >>> os.path.commonprefix(['/dir1/dir2', '/dir3/dir4'])
+ '/dir'
+
+ >>> os.path.commonpath(['/dir1/dir2', '/dir3/dir4'])
+ '/'
.. function:: dirname(path)
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list