Patch #750542: pprint now will pretty print subclasses of list, tuple
and dict too, as long as they don't overwrite __repr__().
diff --git a/Lib/pprint.py b/Lib/pprint.py
index 16d8eae..19b9661 100644
--- a/Lib/pprint.py
+++ b/Lib/pprint.py
@@ -90,9 +90,9 @@
         """
         indent = int(indent)
         width = int(width)
-        assert indent >= 0
+        assert indent >= 0, "indent must be >= 0"
         assert depth is None or depth > 0, "depth must be > 0"
-        assert width
+        assert width, "width must be != 0"
         self._depth = depth
         self._indent_per_level = indent
         self._width = width
@@ -130,7 +130,8 @@
         write = stream.write
 
         if sepLines:
-            if typ is dict:
+            r = typ.__repr__
+            if issubclass(typ, dict) and r is dict.__repr__:
                 write('{')
                 if self._indent_per_level > 1:
                     write((self._indent_per_level - 1) * ' ')
@@ -157,8 +158,9 @@
                 write('}')
                 return
 
-            if typ is list or typ is tuple:
-                if typ is list:
+            if (issubclass(typ, list) and r is list.__repr__) or \
+               (issubclass(typ, tuple) and r is tuple.__repr__):
+                if issubclass(typ, list):
                     write('[')
                     endchar = ']'
                 else:
@@ -179,7 +181,7 @@
                                           allowance + 1, context, level)
                     indent = indent - self._indent_per_level
                     del context[objid]
-                if typ is tuple and length == 1:
+                if issubclass(typ, tuple) and length == 1:
                     write(',')
                 write(endchar)
                 return
@@ -226,7 +228,8 @@
                 write(qget(char, `char`[1:-1]))
         return ("%s%s%s" % (closure, sio.getvalue(), closure)), True, False
 
-    if typ is dict:
+    r = typ.__repr__
+    if issubclass(typ, dict) and r is dict.__repr__:
         if not object:
             return "{}", True, False
         objid = _id(object)
@@ -251,8 +254,9 @@
         del context[objid]
         return "{%s}" % _commajoin(components), readable, recursive
 
-    if typ is list or typ is tuple:
-        if typ is list:
+    if (issubclass(typ, list) and r is list.__repr__) or \
+       (issubclass(typ, tuple) and r is tuple.__repr__):
+        if issubclass(typ, list):
             if not object:
                 return "[]", True, False
             format = "[%s]"