gh-121645: Add PyBytes_Join() function (#121646)

* Replace _PyBytes_Join() with PyBytes_Join().
* Keep _PyBytes_Join() as an alias to PyBytes_Join().
This commit is contained in:
Victor Stinner 2024-08-30 14:57:33 +02:00 committed by GitHub
parent 7fca268bee
commit 3d60dfbe17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 101 additions and 12 deletions

View file

@ -37,8 +37,23 @@ bytes_resize(PyObject *Py_UNUSED(module), PyObject *args)
}
/* Test PyBytes_Join() */
static PyObject *
bytes_join(PyObject *Py_UNUSED(module), PyObject *args)
{
PyObject *sep, *iterable;
if (!PyArg_ParseTuple(args, "OO", &sep, &iterable)) {
return NULL;
}
NULLABLE(sep);
NULLABLE(iterable);
return PyBytes_Join(sep, iterable);
}
static PyMethodDef test_methods[] = {
{"bytes_resize", bytes_resize, METH_VARARGS},
{"bytes_join", bytes_join, METH_VARARGS},
{NULL},
};