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

2009-12-26 Thread Ecir Hana
On Dec 27, 3:15 am, Benjamin Peterson wrote: > Yes, you still own the reference to the function. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

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

2009-12-26 Thread Benjamin Peterson
Ecir Hana gmail.com> writes: > do I have to > > Py_DECREF(function) > > or not? Yes, you still own the reference to the function. -- http://mail.python.org/mailman/listinfo/python-list

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

2009-12-26 Thread Ecir Hana
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? -- http://mail.python.org/