]> granicus.if.org Git - python/commitdiff
Bug #1688564: document os.path.join's absolute path behavior in the docstring.
authorGeorg Brandl <georg@python.org>
Thu, 23 Aug 2007 21:27:57 +0000 (21:27 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 23 Aug 2007 21:27:57 +0000 (21:27 +0000)
Lib/ntpath.py
Lib/posixpath.py

index 99d7a4a8cdcf73dabfb40caa605d3e468ae5b43c..06b2293293ee1cb179cb04aa50a8b4dcb2392d64 100644 (file)
@@ -59,7 +59,9 @@ def isabs(s):
 # Join two (or more) paths.
 
 def join(a, *p):
-    """Join two or more pathname components, inserting "\\" as needed"""
+    """Join two or more pathname components, inserting "\\" as needed.
+    If any component is an absolute path, all previous path components
+    will be discarded."""
     path = a
     for b in p:
         b_wins = 0  # set to 1 iff b makes path irrelevant
index 6f15d48f127aac820741711edbe2fece1f96672d..6d4a9e2111bd5d4631bc081f215266daa34a3745 100644 (file)
@@ -56,7 +56,9 @@ def isabs(s):
 # Insert a '/' unless the first part is empty or already ends in '/'.
 
 def join(a, *p):
-    """Join two or more pathname components, inserting '/' as needed"""
+    """Join two or more pathname components, inserting '/' as needed.
+    If any component is an absolute path, all previous path components
+    will be discarded."""
     path = a
     for b in p:
         if b.startswith('/'):