diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-07-25 23:36:00 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-07-25 23:36:00 +0300 |
commit | 465e60e654732b3a0b726d1fd82950fc982fcba2 (patch) | |
tree | 25a1567d99855ff0a2ffcdc1f7c7659f85aaaa0b /Lib/xml | |
parent | 54701f303fdde38c53811776ba2d16fabf219dcc (diff) | |
download | cpython-git-465e60e654732b3a0b726d1fd82950fc982fcba2.tar.gz |
Issue #22033: Reprs of most Python implemened classes now contain actual
class name instead of hardcoded one.
Diffstat (limited to 'Lib/xml')
-rw-r--r-- | Lib/xml/dom/minidom.py | 5 | ||||
-rw-r--r-- | Lib/xml/etree/ElementTree.py | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py index c379a332e1..c76b14d6a4 100644 --- a/Lib/xml/dom/minidom.py +++ b/Lib/xml/dom/minidom.py @@ -648,9 +648,10 @@ class TypeInfo(object): def __repr__(self): if self.namespace: - return "<TypeInfo %r (from %r)>" % (self.name, self.namespace) + return "<%s %r (from %r)>" % (self.__class__.__name__, self.name, + self.namespace) else: - return "<TypeInfo %r>" % self.name + return "<%s %r>" % (self.__class__.__name__, self.name) def _get_name(self): return self.name diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index d9e98078c8..6c1345a5ad 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -174,7 +174,7 @@ class Element: self._children = [] def __repr__(self): - return "<Element %s at 0x%x>" % (repr(self.tag), id(self)) + return "<%s %r at %#x>" % (self.__class__.__name__, self.tag, id(self)) def makeelement(self, tag, attrib): """Create a new element with the same type. @@ -509,7 +509,7 @@ class QName: def __str__(self): return self.text def __repr__(self): - return '<QName %r>' % (self.text,) + return '<%s %r>' % (self.__class__.__name__, self.text) def __hash__(self): return hash(self.text) def __le__(self, other): |