More bug 460020:  lots of string optimizations inhibited for string
subclasses, all "the usual" ones (slicing etc), plus replace, translate,
ljust, rjust, center and strip.  I don't know how to be sure they've all
been caught.

Question:  Should we complain if someone tries to intern an instance of
a string subclass?  I hate to slow any code on those paths.
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 11a3a5d..a29eb23 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -1481,9 +1481,32 @@
     verify(str(s) == "12345")
     verify(str(s).__class__ is str)
 
-    s = madstring("\x00" * 5)
-    verify(str(s) == "\x00" * 5)
+    base = "\x00" * 5
+    s = madstring(base)
+    verify(str(s) == base)
     verify(str(s).__class__ is str)
+    verify((s + "").__class__ is str)
+    verify(("" + s).__class__ is str)
+    verify((s * 0).__class__ is str)
+    verify((s * 1).__class__ is str)
+    verify((s * 2).__class__ is str)
+    verify(s[:].__class__ is str)
+    verify(s[0:0].__class__ is str)
+    verify(s.strip().__class__ is str)
+    identitytab = ''.join([chr(i) for i in range(256)])
+    verify(s.translate(identitytab).__class__ is str)
+    verify(s.translate(identitytab) == base)
+    verify(s.translate(identitytab, "x").__class__ is str)
+    verify(s.translate(identitytab, "x") == base)
+    verify(s.translate(identitytab, "\x00") == "")
+    verify(s.replace("x", "x").__class__ is str)
+    verify(s.replace("x", "x") == base)
+    verify(s.ljust(len(s)).__class__ is str)
+    verify(s.ljust(len(s)) == base)
+    verify(s.rjust(len(s)).__class__ is str)
+    verify(s.rjust(len(s)) == base)
+    verify(s.center(len(s)).__class__ is str)
+    verify(s.center(len(s)) == base)
 
     class madunicode(unicode):
         _rev = None