From: Guido van Rossum Date: Thu, 9 Aug 2001 18:56:27 +0000 (+0000) Subject: Use type(x).__name__ to get the name of the type instead of parsing X-Git-Tag: v2.2a3~703 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a995c91243fe1980551b81b116ec93bb9a38a974;p=thirdparty%2FPython%2Fcpython.git Use type(x).__name__ to get the name of the type instead of parsing repr(type(x)). --- diff --git a/Lib/repr.py b/Lib/repr.py index f9cfcf647aa7..f418d1a5f60d 100644 --- a/Lib/repr.py +++ b/Lib/repr.py @@ -14,7 +14,7 @@ class Repr: def repr(self, x): return self.repr1(x, self.maxlevel) def repr1(self, x, level): - typename = `type(x)`[7:-2] # "" + typename = type(x).__name__ if ' ' in typename: parts = typename.split() typename = '_'.join(parts)