diff options
author | Guido van Rossum <guido@python.org> | 2001-08-09 18:56:27 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-08-09 18:56:27 (GMT) |
commit | a995c91243fe1980551b81b116ec93bb9a38a974 (patch) | |
tree | 45b9850ea4745224fecb460e53b5a22102da1702 | |
parent | 0263c80b90e9abb312601bc176b8176665953dc7 (diff) | |
download | cpython-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.py | 2 |
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) |