Schimon Jehudah schrieb am 09.09.25 um 13:16:
On Tue, 9 Sep 2025 08:50:41 +0200
Stefan Behnel via lxml - The Python XML Toolkit <[email protected]> wrote:
xml_data_bytes = memoryview(newdom)
xml_data_str = str(xml_data_bytes, 'UTF-8')
Did you mean to write.
xml_data_bytes = memoryview(newdom).tobytes()
xml_data_str = str(xml_data_bytes, 'UTF-8')
No, that would force Python to create two intermediate copies of the bytes
data. One is enough.
Stefan
_______________________________________________
lxml - The Python XML Toolkit mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/lxml.python.org
Member address: [email protected]