commit | a995c91243fe1980551b81b116ec93bb9a38a974 | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Thu Aug 09 18:56:27 2001 +0000 |
committer | Guido van Rossum <guido@python.org> | Thu Aug 09 18:56:27 2001 +0000 |
tree | 45b9850ea4745224fecb460e53b5a22102da1702 | |
parent | 0263c80b90e9abb312601bc176b8176665953dc7 [diff] |
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 f9cfcf6..f418d1a 100644 --- a/Lib/repr.py +++ b/Lib/repr.py
@@ -14,7 +14,7 @@ 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)