Message309009
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. |
|
Date |
User |
Action |
Args |
2017-12-24 18:36:59 | gphemsley | set | recipients:
+ gphemsley, rhettinger, scoder, eli.bendersky, py.user, serhiy.storchaka |
2017-12-24 18:36:59 | gphemsley | set | messageid: <1514140619.51.0.213398074469.issue28236@psf.upfronthosting.co.za> |
2017-12-24 18:36:59 | gphemsley | link | issue28236 messages |
2017-12-24 18:36:59 | gphemsley | create | |
|