Minor style nits.

This commit is contained in:
Fred Drake 2000-09-28 16:22:52 +00:00
parent 22fb839f0c
commit c0ab93ef6f

View file

@ -56,7 +56,7 @@ def join(a, *p):
def split(p): def split(p):
"""Split a pathname. Returns tuple "(head, tail)" where "tail" is """Split a pathname. Returns tuple "(head, tail)" where "tail" is
everything after the final slash. Either part may be empty""" everything after the final slash. Either part may be empty."""
i = p.rfind('/') + 1 i = p.rfind('/') + 1
head, tail = p[:i], p[i:] head, tail = p[:i], p[i:]
if head and head <> '/'*len(head): if head and head <> '/'*len(head):
@ -72,7 +72,7 @@ everything after the final slash. Either part may be empty"""
def splitext(p): def splitext(p):
"""Split the extension from a pathname. Extension is everything from the """Split the extension from a pathname. Extension is everything from the
last dot to the end. Returns "(root, ext)", either part may be empty""" last dot to the end. Returns "(root, ext)", either part may be empty."""
root, ext = '', '' root, ext = '', ''
for c in p: for c in p:
if c == '/': if c == '/':
@ -94,7 +94,7 @@ last dot to the end. Returns "(root, ext)", either part may be empty"""
def splitdrive(p): def splitdrive(p):
"""Split a pathname into drive and path. On Posix, drive is always """Split a pathname into drive and path. On Posix, drive is always
empty""" empty."""
return '', p return '', p
@ -280,7 +280,7 @@ of all the files and subdirs in directory "d".
def expanduser(path): def expanduser(path):
"""Expand ~ and ~user constructions. If user or $HOME is unknown, """Expand ~ and ~user constructions. If user or $HOME is unknown,
do nothing""" do nothing."""
if path[:1] <> '~': if path[:1] <> '~':
return path return path
i, n = 1, len(path) i, n = 1, len(path)
@ -309,7 +309,7 @@ _varprog = None
def expandvars(path): def expandvars(path):
"""Expand shell variables of form $var and ${var}. Unknown variables """Expand shell variables of form $var and ${var}. Unknown variables
are left unchanged""" are left unchanged."""
global _varprog global _varprog
if '$' not in path: if '$' not in path:
return path return path