[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

Serhiy Storchaka report at bugs.python.org
Thu Sep 22 05:02:11 EDT 2016


Serhiy Storchaka added the comment:

The built-in ElementTree package is derived from lxml.etree. I suppose that the documentation is inherited from lxml.etree.

The built-in ElementTree package supports duck typing. The element object is not always an instance of the Element class. iselement() is not equal to isinstance(e, Element), it just tests the existence of the tag attribute. Many ElementTree functions have fast path for Element, but work with duck typed classes too. I believe that in particular you can mix Python and C implementations of Element and lxml.etree elements in one tree.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28234>
_______________________________________


More information about the Python-bugs-list mailing list