[New-bugs-announce] [issue10661] ElementTree QName has a very uninformative repr()

Jean-Paul Calderone report at bugs.python.org
Thu Dec 9 17:54:10 CET 2010


New submission from Jean-Paul Calderone <invalid at 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 <report at bugs.python.org>
<http://bugs.python.org/issue10661>
_______________________________________


More information about the New-bugs-announce mailing list