Santoso Wijaya added the comment:

There is still a matter of inconsistency between the two implementations and 
between 2.7 and 3.x. IMO, the Python-based ElementTree implementation is more 
graceful at handling the "attrib" argument.

The signature of the factory function Element (and SubElement) in the doc is 
thus:

    class xml.etree.ElementTree.Element(tag, attrib={}, **extra)


which is fair game for the user to use "attrib" as a keyword argument.

Further, this serialization (in 3.x) does not really make sense, anyway:

>>> cET.tostring(root)
b'<root attrib="{\'Name\': \'Root\'}"><child attrib="{\'Name\': \'Child\'}" 
/></root>'

----------
components: +XML

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

Reply via email to