summaryrefslogtreecommitdiffstats
path: root/Lib/UserString.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-10-16 18:12:55 (GMT)
committerGuido van Rossum <guido@python.org>2007-10-16 18:12:55 (GMT)
commit3172c5d263eeffff1e89d03d79be3ccc1d60fbde (patch)
treea35e103b36b684c4682ded57236199d6a0ecee4b /Lib/UserString.py
parent60d241f135f10312f5a638846659d7e471f6cac9 (diff)
downloadcpython-3172c5d263eeffff1e89d03d79be3ccc1d60fbde.zip
cpython-3172c5d263eeffff1e89d03d79be3ccc1d60fbde.tar.gz
cpython-3172c5d263eeffff1e89d03d79be3ccc1d60fbde.tar.bz2
Patch# 1258 by Christian Heimes: kill basestring.
I like this because it makes the code shorter! :-)
Diffstat (limited to 'Lib/UserString.py')
-rwxr-xr-xLib/UserString.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/UserString.py b/Lib/UserString.py
index 8417be7..a11717c 100755
--- a/Lib/UserString.py
+++ b/Lib/UserString.py
@@ -11,7 +11,7 @@ __all__ = ["UserString","MutableString"]
class UserString:
def __init__(self, seq):
- if isinstance(seq, basestring):
+ if isinstance(seq, str):
self.data = seq
elif isinstance(seq, UserString):
self.data = seq.data[:]
@@ -66,12 +66,12 @@ class UserString:
def __add__(self, other):
if isinstance(other, UserString):
return self.__class__(self.data + other.data)
- elif isinstance(other, basestring):
+ elif isinstance(other, str):
return self.__class__(self.data + other)
else:
return self.__class__(self.data + str(other))
def __radd__(self, other):
- if isinstance(other, basestring):
+ if isinstance(other, str):
return self.__class__(other + self.data)
else:
return self.__class__(str(other) + self.data)
@@ -184,7 +184,7 @@ class MutableString(UserString):
if isinstance(index, slice):
if isinstance(sub, UserString):
sub = sub.data
- elif not isinstance(sub, basestring):
+ elif not isinstance(sub, str):
sub = str(sub)
start, stop, step = index.indices(len(self.data))
if step == -1:
@@ -221,7 +221,7 @@ class MutableString(UserString):
def __iadd__(self, other):
if isinstance(other, UserString):
self.data += other.data
- elif isinstance(other, basestring):
+ elif isinstance(other, str):
self.data += other
else:
self.data += str(other)