[Python-checkins] CVS: python/dist/src/Lib repr.py,1.7,1.8
Eric S. Raymond
esr@users.sourceforge.net
Fri, 09 Feb 2001 00:53:10 -0800
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv22798
Modified Files:
repr.py
Log Message:
String method conversion.
Index: repr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/repr.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** repr.py 2001/01/15 01:18:21 1.7
--- repr.py 2001/02/09 08:53:08 1.8
***************
*** 1,6 ****
"""Redo the `...` (representation) but with limits on most sizes."""
- import string
-
class Repr:
def __init__(self):
--- 1,4 ----
***************
*** 17,22 ****
typename = `type(x)`[7:-2] # "<type '......'>"
if ' ' in typename:
! parts = string.split(typename)
! typename = string.joinfields(parts, '_')
if hasattr(self, 'repr_' + typename):
return getattr(self, 'repr_' + typename)(x, level)
--- 15,20 ----
typename = `type(x)`[7:-2] # "<type '......'>"
if ' ' in typename:
! parts = typename.split()
! typename = '_'.join(parts)
if hasattr(self, 'repr_' + typename):
return getattr(self, 'repr_' + typename)(x, level)