[issue10661] ElementTree QName has a very uninformative repr()
New submission from Jean-Paul Calderone inva...@example.invalid: This is somewhat unfortunate behavior: from xml.etree.ElementTree import QName QName('foo') xml.etree.ElementTree.QName instance at 0x10049c830 It becomes even more apparent when encountered in a situation like this: print {QName('foo'): 'bar', QName('baz'): 'quux'} {xml.etree.ElementTree.QName instance at 0x10049cb90: 'bar', xml.etree.ElementTree.QName instance at 0x10049c248: 'quux'} I would like to see QName.__repr__ return something like 'QName %r' % (text,) -- messages: 123687 nosy: exarkun priority: normal severity: normal status: open title: ElementTree QName has a very uninformative repr() type: behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10661 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10661] ElementTree QName has a very uninformative repr()
Georg Brandl ge...@python.org added the comment: Added in r87147. -- nosy: +georg.brandl resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10661 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10661] ElementTree QName has a very uninformative repr()
Eric Smith e...@trueblade.com added the comment: This should be either: 'QName %r' % (self.text,) or: 'QName {!r}'.format(self.text) If self.text is a tuple (which granted is its own error), then the version checked in will raise an exception. -- nosy: +eric.smith resolution: fixed - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10661 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10661] ElementTree QName has a very uninformative repr()
Georg Brandl ge...@python.org added the comment: Granted. Since the rest of the file uses old-style format, I've kept to it, r87148. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10661 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com