]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
MutableSequence requires an insert() method.
authorRaymond Hettinger <python@rcn.com>
Wed, 6 Feb 2008 22:14:55 +0000 (22:14 +0000)
committerRaymond Hettinger <python@rcn.com>
Wed, 6 Feb 2008 22:14:55 +0000 (22:14 +0000)
Lib/UserString.py

index 615c135f164576706b329b8df68de98326184ca1..c3267ad73331496e88e7205056b30967b08e512e 100755 (executable)
@@ -232,6 +232,8 @@ class MutableString(UserString, collections.MutableSequence):
     def __imul__(self, n):
         self.data *= n
         return self
+    def insert(self, index, value):
+        self[index:index] = value
 
 collections.MutableSequence.register(MutableString)