Skip to content

Commit

Permalink
String method conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-s-raymond committed Feb 9, 2001
1 parent dcd3a87 commit e37340e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions Lib/multifile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"""

import sys
import string

__all__ = ["MultiFile","Error"]

Expand Down Expand Up @@ -88,10 +87,7 @@ def readline(self):
return line
else:
# Ignore trailing whitespace on marker lines
k = len(line) - 1
while line[k] in string.whitespace:
k = k - 1
marker = line[:k+1]
marker = line.rstrip()
# No? OK, try to match a boundary.
# Return the line (unstripped) if we don't.
for i in range(len(self.stack)):
Expand Down Expand Up @@ -121,7 +117,7 @@ def readlines(self):
return list

def read(self): # Note: no size argument -- read until EOF only!
return string.joinfields(self.readlines(), '')
return self.readlines().join('')

def next(self):
while self.readline(): pass
Expand Down
2 changes: 1 addition & 1 deletion Lib/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def maketrans(fromstr, tostr):
fromstr = map(ord, fromstr)
for i in range(len(fromstr)):
L[fromstr[i]] = tostr[i]
return joinfields(L, "")
return join(L, "")

# Substring replacement (global)
def replace(s, old, new, maxsplit=-1):
Expand Down
2 changes: 1 addition & 1 deletion Lib/stringold.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def maketrans(fromstr, tostr):
fromstr = map(ord, fromstr)
for i in range(len(fromstr)):
L[fromstr[i]] = tostr[i]
return joinfields(L, "")
return join(L, "")

# Substring replacement (global)
def replace(s, old, new, maxsplit=0):
Expand Down

0 comments on commit e37340e

Please sign in to comment.