mirror of https://github.com/python/cpython
#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.
This commit is contained in:
parent
d33a9beb8d
commit
ac9b5c67d3
|
@ -68,7 +68,8 @@ def isabs(s):
|
||||||
def join(a, *p):
|
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
|
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
|
path = a
|
||||||
for b in p:
|
for b in p:
|
||||||
if b.startswith('/'):
|
if b.startswith('/'):
|
||||||
|
|
Loading…
Reference in New Issue