Gordon P. Hemsley <gphems...@gphemsley.org> added the comment:

To be clear, we are talking about the Element class of the ElementTree module, 
which is distinct from the ElementTree class of the same module.

That said, I personally question the implementation decision to represent 
things like treating comments as an Element with a tag of a Comment function. 
The XML standard is pretty clear that neither comments nor processing 
instructions are in fact elements, and I don't see it as a Good Thing that 
arbitrary objects are allowed as the value of tag, unless there is a 
requirement that such objects are subclasses of str.

Note also that the documentation makes no mention of tag being anything other 
than a string. And there is inconsistency with where bytes are supposedly 
allowed (according to the documentation) and where they're actually allowed 
(according to the code). Given this, I think it's hard to say what user code is 
expected to make use of.

----------

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

Reply via email to