mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
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:
parent
7fca268bee
commit
3d60dfbe17
10 changed files with 101 additions and 12 deletions
|
@ -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},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue