[Python-checkins] cpython (3.2): #15342: Add clarifying sentence to posixpath.join docstring.

r.david.murray python-checkins at python.org
Sat Jul 21 20:38:35 CEST 2012


http://hg.python.org/cpython/rev/61d0e3526a51
changeset:   78223:61d0e3526a51
branch:      3.2
parent:      78220:c8534d55c5e6
user:        R David Murray <rdmurray at bitdance.com>
date:        Sat Jul 21 14:33:56 2012 -0400
summary:
  #15342: Add clarifying sentence to posixpath.join docstring.

This sentence appears as a clarifying note in the HTML docs, and seems
worth having in the docstring since it covers a very common use case
that isn't otherwise obvious.  Thanks to Yongzhi Pan for the suggestion.

files:
  Lib/posixpath.py |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Lib/posixpath.py b/Lib/posixpath.py
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -71,7 +71,8 @@
 def join(a, *p):
     """Join two or more pathname components, inserting '/' as needed.
     If any component is an absolute path, all previous path components
-    will be discarded."""
+    will be discarded.  An empty last part will result in a path that
+    ends with a separator."""
     sep = _get_sep(a)
     path = a
     try:

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list