Bug #1688564: document os.path.join's absolute path behavior in the docstring.

This commit is contained in:
Georg Brandl 2007-08-23 21:27:57 +00:00
parent b7a837d81b
commit da5f16ab19
2 changed files with 6 additions and 2 deletions

View 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

View 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('/'):