summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-08-09 18:56:27 (GMT)
committerGuido van Rossum <guido@python.org>2001-08-09 18:56:27 (GMT)
commita995c91243fe1980551b81b116ec93bb9a38a974 (patch)
tree45b9850ea4745224fecb460e53b5a22102da1702
parent0263c80b90e9abb312601bc176b8176665953dc7 (diff)
downloadcpython-a995c91243fe1980551b81b116ec93bb9a38a974.zip
cpython-a995c91243fe1980551b81b116ec93bb9a38a974.tar.gz
cpython-a995c91243fe1980551b81b116ec93bb9a38a974.tar.bz2
Use type(x).__name__ to get the name of the type instead of parsing
repr(type(x)).
-rw-r--r--Lib/repr.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/repr.py b/Lib/repr.py
index f9cfcf6..f418d1a 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] # "<type '......'>"
+ typename = type(x).__name__
if ' ' in typename:
parts = typename.split()
typename = '_'.join(parts)