summaryrefslogtreecommitdiffstats
path: root/Lib/macpath.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-11-05 10:43:02 (GMT)
committerGuido van Rossum <guido@python.org>1992-11-05 10:43:02 (GMT)
commitc629d34c4f1797b690a6c93ea3e2a5b82698b686 (patch)
tree812dcbc9fd664f9a5354e3301d7aa2375d85517a /Lib/macpath.py
parent1115ab2a7469746859655cfa7f717c794a8a22ab (diff)
downloadcpython-c629d34c4f1797b690a6c93ea3e2a5b82698b686.zip
cpython-c629d34c4f1797b690a6c93ea3e2a5b82698b686.tar.gz
cpython-c629d34c4f1797b690a6c93ea3e2a5b82698b686.tar.bz2
* change default line numbers for 'list' in pdb.py
* changed eval() into getattr() in cmd.py * added dirname(), basename() and (dummy) normath() to macpath.py * renamed nntp.py to nntplib.py * Made string.index() compatible with strop.index() * Make string.atoi('') raise string.atoi_error rather than ValueError * Added dirname() and normpath() to posixpath.
Diffstat (limited to 'Lib/macpath.py')
-rw-r--r--Lib/macpath.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/macpath.py b/Lib/macpath.py
index 47f695a..b5c17f0 100644
--- a/Lib/macpath.py
+++ b/Lib/macpath.py
@@ -46,6 +46,12 @@ def split(s):
return s[:colon], s[colon:]
+# Short interfaces to split()
+
+def dirname(s): return split(s)[0]
+def basename(s): return split(s)[1]
+
+
# XXX This is undocumented and may go away!
# Normalize a pathname: get rid of '::' sequences by backing up,
# e.g., 'foo:bar::bletch' becomes 'foo:bletch'.
@@ -112,3 +118,9 @@ def exists(s):
except mac.error:
return 0
return 1
+
+
+# Normalize path, removing things like ...:A:..:... (yet to be written)
+
+def normpath(s):
+ return s