]> granicus.if.org Git - python/commitdiff
#15342: Add clarifying sentence to posixpath.join docstring.
authorR David Murray <rdmurray@bitdance.com>
Sat, 21 Jul 2012 18:37:29 +0000 (14:37 -0400)
committerR David Murray <rdmurray@bitdance.com>
Sat, 21 Jul 2012 18:37:29 +0000 (14:37 -0400)
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.

Lib/posixpath.py

index 690c70da374b660517d656ad45ae17f15da3a4bb..5ddf25b10672090e37ae0ad43e19e6594f88bc56 100644 (file)
@@ -68,7 +68,8 @@ def isabs(s):
 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."""
     path = a
     for b in p:
         if b.startswith('/'):