Message 342072 - Python tracker

Message342072

Author scoder
Recipients Pierre van de Laar, scoder
Date 2019-05-10.12:32:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557491529.18.0.311203306756.issue36874@roundup.psfhosted.org>
In-reply-to
Content
PR welcome. This is how lxml implements it:
https://lxml.de/api.html#cdata

Tests are here:
https://github.com/lxml/lxml/blob/1a2db33aa8b9619c1caf407167567d5cca0b9019/src/lxml/tests/test_etree.py#L1692-L1749

I guess it won't look perfectly the same in ElementTree in the end, but it might be enough to implement a string wrapper class (or even str subclass?), and then maybe special-case it in the serialiser (probably needed for the escaping). However, anything that relieves the serialiser from doing special work for this exceptional case might be a good idea.
History
Date User Action Args
2019-05-10 12:32:09scodersetrecipients: + scoder, Pierre van de Laar
2019-05-10 12:32:09scodersetmessageid: <1557491529.18.0.311203306756.issue36874@roundup.psfhosted.org>
2019-05-10 12:32:09scoderlinkissue36874 messages
2019-05-10 12:32:08scodercreate