diff options
author | Fred Drake <fdrake@acm.org> | 2000-12-12 23:20:45 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-12-12 23:20:45 (GMT) |
commit | 8152d32375c40bba9ccbe43b780ebe96d9617781 (patch) | |
tree | f10aba5ba6f1e3064b26d2edfd6fffb45378245d /Lib/posixpath.py | |
parent | c140131995c67b1cd001b5c27e0095c53b1204b4 (diff) | |
download | cpython-8152d32375c40bba9ccbe43b780ebe96d9617781.zip cpython-8152d32375c40bba9ccbe43b780ebe96d9617781.tar.gz cpython-8152d32375c40bba9ccbe43b780ebe96d9617781.tar.bz2 |
Update the code to better reflect recommended style:
Use != instead of <> since <> is documented as "obsolescent".
Use "is" and "is not" when comparing with None or type objects.
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r-- | Lib/posixpath.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py index 2826604..32850b4 100644 --- a/Lib/posixpath.py +++ b/Lib/posixpath.py @@ -59,7 +59,7 @@ def split(p): everything after the final slash. Either part may be empty.""" i = p.rfind('/') + 1 head, tail = p[:i], p[i:] - if head and head <> '/'*len(head): + if head and head != '/'*len(head): while head[-1] == '/': head = head[:-1] return head, tail @@ -120,7 +120,7 @@ def commonprefix(m): prefix = m[0] for item in m: for i in range(len(prefix)): - if prefix[:i+1] <> item[:i+1]: + if prefix[:i+1] != item[:i+1]: prefix = prefix[:i] if i == 0: return '' break @@ -281,10 +281,10 @@ def walk(top, func, arg): def expanduser(path): """Expand ~ and ~user constructions. If user or $HOME is unknown, do nothing.""" - if path[:1] <> '~': + if path[:1] != '~': return path i, n = 1, len(path) - while i < n and path[i] <> '/': + while i < n and path[i] != '/': i = i + 1 if i == 1: if not os.environ.has_key('HOME'): |