Closed vstinner closed 2 months ago
mypyc uses it.
A code search on PyPI top 7,500 projects found 6 projects using the private _PyBytes_Join()
function:
mypyc uses it
Sorry, I forgot to add a reference to the mypy issue: issue gh-121489.
Additionally, many repositories use _PyBytes_Resize
as well. Perhaps that's something that should go public?
Additionally, many repositories use _PyBytes_Resize as well. Perhaps that's something that should go public?
IMO _PyBytes_Resize() is a bad pattern, it uses a bytes object which is incomplete/inconsistent: see https://github.com/capi-workgroup/api-evolution/issues/36.
Instead, I created https://github.com/python/cpython/issues/121710: [C API] Add PyBytesWriter API.
Implemented by the change https://github.com/python/cpython/commit/3d60dfbe1755e00ab20d0ee81281886be77ad5da.
Feature or enhancement
Python 3.13 alpha 1 removed the private
_PyBytes_Join(sep, iterable)
function which callssep.join(iterable)
.mypyc uses it. Since we already have
PyUnicode_Join(sep, iterable)
, I propose to add a newPyBytes_Join()
function.In practice, it's just about renaming
_PyBytes_Join()
toPyBytes_Join()
.Linked PRs