New submission from Neil Muller <drnlmuller+b...@gmail.com>:

ElementTree and cElementTree give slightly different results for
repr(Element):

>>> import xml.etree.ElementTree as ET
>>> import xml.etree.cElementTree as cET
>>> repr(ET.ElementTree('tag'))
'<Element tag at b7cf506c>'
>>> repr(cET.ElementTree('tag')
"<Element 'tag' at 0xb7c266f8>"

The quoting around the tag name is missing from ElementTree.

This inconsistency seems pointless.

Attached patch changes ElementTree to match cElementTree behaviour, and
adds a test.

----------
components: Library (Lib)
files: repr-fix.diff
keywords: patch
messages: 89035
nosy: Neil Muller, effbot
severity: normal
status: open
title: ElementTree.Element and cElementTree.Element have slightly different repr
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1
Added file: http://bugs.python.org/file14212/repr-fix.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6230>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to