PyCFunction_New(): to Py_DECREF() or not to Py_DECREF()

Ecir Hana ecir.hana at gmail.com
Sat Dec 26 17:27:58 EST 2009


Hello,

if creating new CFunction

PyObject *function = PyCFunction_New(function_name, NULL);

and then this is the only thing which uses it ("dictionary" stays
alive...)

PyDict_SetItemString(dictionary, "function", function);

do I have to

Py_DECREF(function)

or not?



More information about the Python-list mailing list