Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writer APIs for str and bytes should be public #70

Open
malemburg opened this issue Aug 7, 2023 · 4 comments
Open

Writer APIs for str and bytes should be public #70

malemburg opened this issue Aug 7, 2023 · 4 comments

Comments

@malemburg
Copy link

These are useful when creating larger strings or bytes arrays from C and hide away the details of the usual allocate/write/resize dance, which was the default way of doing things before we had the writer APIs (the str object still supports this via PyUnicode_Resize(), bytes do so as well, but only via the private _PyString_Resize()).

@gvanrossum
Copy link

@malemburg To make it easier to find this issue when searching for APIs, and to find the APIs you propose to make public, can you name the specific APIs please?

@vstinner
Copy link
Contributor

I proposed a new PyUnicodeWriter API which was just approved by the C API WG: capi-workgroup/decisions#27

The _PyBytesWriter API is still private.

@malemburg
Copy link
Author

I proposed a new PyUnicodeWriter API which was just approved by the C API WG: capi-workgroup/decisions#27

Great. Would have been nice to ping me on this for comments, since I was not aware of your proposal.

The _PyBytesWriter API is still private.

This should be made public in the same way.

@vstinner
Copy link
Contributor

Writer APIs for str and bytes should be public

I just created python/cpython#121710 [C API] Add PyBytesWriter API.

Great. Would have been nice to ping me on this for comments, since I was not aware of your proposal.

I wasn't aware of this issue. I found it after the decision was taken on PyUnicodeWriter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants