Extended tuple's C API to include a new function, PyTuple_Pack() that is

useful for rapidly building argument tuples without having to invoke the
more sophisticated machinery of Py_BuildValue().
This commit is contained in:
Raymond Hettinger 2003-10-12 18:24:34 +00:00
parent d662548c72
commit cb2da43db8
4 changed files with 37 additions and 1 deletions

View file

@ -35,6 +35,7 @@ PyAPI_FUNC(PyObject *) PyTuple_GetItem(PyObject *, int);
PyAPI_FUNC(int) PyTuple_SetItem(PyObject *, int, PyObject *);
PyAPI_FUNC(PyObject *) PyTuple_GetSlice(PyObject *, int, int);
PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, int);
PyAPI_FUNC(PyObject *) PyTuple_Pack(int, ...);
/* Macro, trading safety for speed */
#define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])