Stefan Behnel <stefan...@behnel.de> added the comment:

I also consider it an actual feature of ElementTree to allow arbitrary objects 
as its tags, even if it's not one of the most prominent. lxml cannot copy this 
because it is based on C libraries internally, but that shouldn't prevent ET 
from allowing it.

The fact that None tags disappear is also definitely a feature. It's an easy 
way to delete tags from trees without requiring any restructuring.

OTOH, whether an empty string should be serialised in the way the OP shows is 
not so clear. The output is not XML. I can't see any use case for this, but it 
feels like a potential source of bugs. I think it would be better to have the 
serialiser explicitly reject this than letting it silently generate broken 
output.

Not something to change in Py3.6, though.

----------
versions: +Python 3.7 -Python 3.6

_______________________________________
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