From a995c91243fe1980551b81b116ec93bb9a38a974 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 9 Aug 2001 18:56:27 +0000 Subject: Use type(x).__name__ to get the name of the type instead of parsing repr(type(x)). --- Lib/repr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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] # "" + typename = type(x).__name__ if ' ' in typename: parts = typename.split() typename = '_'.join(parts) -- cgit v0.12