From 3172c5d263eeffff1e89d03d79be3ccc1d60fbde Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 16 Oct 2007 18:12:55 +0000 Subject: Patch# 1258 by Christian Heimes: kill basestring. I like this because it makes the code shorter! :-) --- Lib/UserString.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Lib/UserString.py') diff --git a/Lib/UserString.py b/Lib/UserString.py index 8417be76e4..a11717c68e 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) -- cgit v1.2.1