On Tue, 1 Feb 2022 at 08:54, Marco Sulla <marco.sulla.pyt...@gmail.com> wrote: > PyObject* d = PyDict_New(); > args = PyTuple_New(2); > PyTuple_SET_ITEM(args, 0, d); > PyTuple_SET_ITEM(args, 1, memo); > Py_DECREF(d); >
https://docs.python.org/3/c-api/tuple.html#c.PyTuple_SET_ITEM SET_ITEM steals a reference, so you'll need to not also decref the dict yourself. ChrisA -- https://mail.python.org/mailman/listinfo/python-list