PEP 756 – [C API] Add PyUnicode_Export() and PyUnicode_Import() C functions

I don’t feel like a strong support for these APIs.

Apparently, it’s too borderline between the stable ABI and exposing “implementation details” (UCS1/UCS2/UCS4 string formats). There are also multiple subtle questions about embedded null characters (NUL) and surrogate characters.

I’m no longer sure that there is a strong use case for these APIs. MarkupSafe may use UTF-8 instead of this API. Or just don’t use the limited C API.

PEP 756 – Add PyUnicode_Export() and PyUnicode_Import() C functions | peps.python.org should be carefully analyzed and PEP 756 may not be the best fit for these projects.

In short, I prefer to reject my PEP. I changed its status to “Withdrawn”.

Thanks everyone who was involved. At least, the PEP document itself is now an useful resource if someone wants to propose a similar API later.

4 Likes