]> granicus.if.org Git - python/commitdiff
add repr_str as alias for repr_string in both HTMLRepr and TextRepr classes
authorSkip Montanaro <skip@pobox.com>
Thu, 7 Mar 2002 22:58:02 +0000 (22:58 +0000)
committerSkip Montanaro <skip@pobox.com>
Thu, 7 Mar 2002 22:58:02 +0000 (22:58 +0000)
- reflects the change in type("").__name__ between 2.1 and 2.2.  The
__name__ field is used to find a method to call for particular types.

Lib/pydoc.py

index b878486ca5487f347e895e426fb9c06311097d09..5b27a09aa632b455c6ab428f0414152f1ab345ab 100755 (executable)
@@ -311,6 +311,8 @@ class HTMLRepr(Repr):
                       r'<font color="#c040c0">\1</font>',
                       self.escape(testrepr))
 
+    repr_str = repr_string
+
     def repr_instance(self, x, level):
         try:
             return self.escape(cram(stripid(repr(x)), self.maxstring))
@@ -860,6 +862,8 @@ class TextRepr(Repr):
             return 'r' + testrepr[0] + test + testrepr[0]
         return testrepr
 
+    repr_str = repr_string
+
     def repr_instance(self, x, level):
         try:
             return cram(stripid(repr(x)), self.maxstring)