
Specifically, that lxml currently treats a text of `None` and a text of an empty string differently, and only creates a self-closing element in the former case:
e = etree.Element('foo') etree.tostring(e, encoding='unicode') '<foo/>' e.text = '' etree.tostring(e, encoding='unicode') '<foo></foo>' e.text = None etree.tostring(e, encoding='unicode') '<foo/>'
this property seems to hold from 3.3.6 to 4.5.1 (though I have not tested every intermediate version), but a cursory search didn't yield hard evidence that it's part of lxml's "contract" that would hold in the future. Incidentally, since gmane is apparently dead the archive link on the info page[0]. Various links to the mailing list in the documentation also link to gmane archives[1] and are thus dead, it's unclear that all of them are recoverable (some show up in the wayback machine, others don't), although most of them seem somewhat outdated e.g. a solution for building debian packages from "SVN sources" or old (10+ years) testimonials, so maybe removing them entirely would be just as well? [0] https://mailman-mail5.webfaction.com/listinfo/lxml [1] https://github.com/lxml/lxml/search?q=gmane&unscoped_q=gmane