Commit a995c912 authored by Guido van Rossum's avatar Guido van Rossum

Use type(x).__name__ to get the name of the type instead of parsing

repr(type(x)).
parent 0263c80b
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment