You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[C API] Add Python PyUnicodeWriter API to the limited C API 3.16 #161172
Currently, the limited C API has only few functions to create a Unicode string, as such PyUnicode_FromString() (from an UTF-8 string) or PyUnicode_FromWideChar() (from a wide string). The C API optimized for PEP 393 "compact strings" (added to Python 3.3) such as PyUnicode_New() and PyUnicode_WRITE() is excluded from the limited C API.
Python 3.14 adds PyUnicodeWriter API which is an efficient way to create a new str object from various string formats (ASCII, UTF-8, wide string, UCS4 string, etc.). This API doesn't expose implementation details (how strings are stored internally), so Python implementations other than CPython should be able to implement this C API in an efficient way.
So I propose adding these 13 functions to the limited C API:
Activity
gh-161172: Add PyUnicodeWriter to the limited C API (#161175)