PyArg_ParseTuple() & Py_DECREF()
Alex Farber
farber at cpan.org
Sat Mar 4 10:05:27 EST 2000
More information about the Python-list mailing list
Sat Mar 4 10:05:27 EST 2000
- Previous message (by thread): SV: PyArg_ParseTuple() & Py_DECREF()
- Next message (by thread): PyArg_ParseTuple() & Py_DECREF()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Fredrik Lundh wrote: > Ralf wrote: > > Consider the following two lines of source code at the > > beginning of a C extension function: > > > > PyObject *O; > > if (! PyArg_ParseTuple(args, "O", &O)) return NULL; > > > > Is it necessary to call Py_DECREF(O) before leaving the > > extension function? > > no. PyArg_ParseTuple returns borrowed references. Do you have to call free(str) after PyArg_ParseTuple (val, "sO", &str, &obj)? Where is str stored? Will it be overwritten after calling PyArg_ParseTuple (val, "sO", &str2, &obj)? Regards Alex
- Previous message (by thread): SV: PyArg_ParseTuple() & Py_DECREF()
- Next message (by thread): PyArg_ParseTuple() & Py_DECREF()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list