Commit 5b81bb65 by willmcgugan

docstring tweak for basename

parent 90608df9
......@@ -211,7 +211,7 @@ def split(path):
def splitext(path):
"""Splits the extension from the path, and returns the path (up to the last
'.' and the extension
'.' and the extension).
:param path: A path to split
......@@ -268,7 +268,7 @@ def dirname(path):
def basename(path):
"""Returns the basename of the resource referenced by a path.
This is always equivalent to the 'head' component of the value returned
This is always equivalent to the 'tail' component of the value returned
by pathsplit(path).
:param path: A FS path
......@@ -276,6 +276,12 @@ def basename(path):
>>> basename('foo/bar/baz')
'baz'
>>> basename('foo/bar')
'bar'
>>> basename('foo/bar/')
''
"""
if '/' not in path:
return path
......
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