Hi,
After multiple iterations on the API, I decided to write down a PEP for the PyBytesWriter C API. It's easier to understand the API with its documentation, examples, and discussions around it. A single document (the PEP) should help the discussion.
-> Read PEP 782: Add PyBytesWriter C API <-
The API is now based on sizes rather than pointers, even if two functions using pointers are provided for convenience.
I plan to submit the PEP to the Steering Council, but first I would like to get the opinion of the C API Working Group.
The API was discussed in length, see the PEP for all links to prior discussions. The most recent thread: https://discuss.python.org/t/pep-782-add-pybyteswriter-c-api/86617.
Abstract
Add a new PyBytesWriter C API to create bytes objects.
Soft deprecate PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize() APIs. These APIs treat an immutable bytes object as a mutable object. They remain available and maintained, don't emit deprecation warning, but are no longer recommended when writing new code.
Vote
I abstain from voting on my own PEP :-)
Hi,
After multiple iterations on the API, I decided to write down a PEP for the PyBytesWriter C API. It's easier to understand the API with its documentation, examples, and discussions around it. A single document (the PEP) should help the discussion.
-> Read PEP 782: Add PyBytesWriter C API <-
The API is now based on sizes rather than pointers, even if two functions using pointers are provided for convenience.
I plan to submit the PEP to the Steering Council, but first I would like to get the opinion of the C API Working Group.
The API was discussed in length, see the PEP for all links to prior discussions. The most recent thread: https://discuss.python.org/t/pep-782-add-pybyteswriter-c-api/86617.
Abstract
Add a new
PyBytesWriterC API to createbytesobjects.Soft deprecate
PyBytes_FromStringAndSize(NULL, size)and_PyBytes_Resize()APIs. These APIs treat an immutablebytesobject as a mutable object. They remain available and maintained, don't emit deprecation warning, but are no longer recommended when writing new code.Vote
I abstain from voting on my own PEP :-)