KyotoCursor *cursor = PyObject_New(KyotoCursor, &yakc_CursorType);APRtype(PyInt_FromLong((long)KYOTO_ITEMS));APRtuple(PyTuple_Pack(2, self, type.get()));intre = Cursor_init(cursor, tuple.get(),NULL);if(re ==0)return(PyObject *)cursor; PyErr_SetString(PyExc_RuntimeError,"Cannot ...
In the cpython codebase PyTuple_Pack is used at various places (https://github.com/search?q=repo%3Apython%2Fcpython+PyTuple_Pack&type=code). The execution is not very fast as the implementation uses va_arg internally. For the 1- and 2 argument case we can improve performance by provid...
PyObject *args = PyTuple_Pack(1, PyLong_FromLongLong(l)); return JPPyObject::call(PyLong_Type.tp_new((PyTypeObject*) wrapper.get(), args, nullptr)); Contributor Thrameos Sep 17, 2024 Seems likely. Once had leaks everwhere. Hence need to write the C++ wrapper for python API...