[Python-checkins] CVS: python/dist/src/Lib repr.py,1.10,1.11
Guido van Rossum
gvanrossum@users.sourceforge.net
Thu, 09 Aug 2001 11:56:29 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv4661
Modified Files:
repr.py
Log Message:
Use type(x).__name__ to get the name of the type instead of parsing
repr(type(x)).
Index: repr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/repr.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** repr.py 2001/08/02 04:15:00 1.10
--- repr.py 2001/08/09 18:56:27 1.11
***************
*** 15,19 ****
return self.repr1(x, self.maxlevel)
def repr1(self, x, level):
! typename = `type(x)`[7:-2] # "<type '......'>"
if ' ' in typename:
parts = typename.split()
--- 15,19 ----
return self.repr1(x, self.maxlevel)
def repr1(self, x, level):
! typename = type(x).__name__
if ' ' in typename:
parts = typename.split()