Commit 4c592cb3 authored by Georg Brandl's avatar Georg Brandl

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

parent 49c676fe
......@@ -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
......
......@@ -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('/'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment