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]
  • [lxml] Re: A possible pr... Schimon Jehudah via lxml - The Python XML Toolkit
    • [lxml] Elements wit... Schimon Jehudah via lxml - The Python XML Toolkit
      • [lxml] Re: Elem... Schimon Jehudah via lxml - The Python XML Toolkit
      • [lxml] Re: Elem... Stefan Behnel via lxml - The Python XML Toolkit
        • [lxml] Re: ... Schimon Jehudah via lxml - The Python XML Toolkit
          • [lxml] ... Schimon Jehudah via lxml - The Python XML Toolkit
          • [lxml] ... Stefan Behnel via lxml - The Python XML Toolkit
            • [l... Schimon Jehudah via lxml - The Python XML Toolkit
            • [l... Schimon Jehudah via lxml - The Python XML Toolkit
              • ... Stefan Behnel via lxml - The Python XML Toolkit
              • ... Schimon Jehudah via lxml - The Python XML Toolkit

Reply via email to