Help with C API

Nick Jacobson nicksjacobson at yahoo.com
Sat May 1 14:15:50 EDT 2004


I don't think I'm stating my question clearly. :(

Say I create a list in my C function:
seq = PyList_New(0);
Then append some numbers to it, whatever.

Then, when I return from the C function and want to use that list in
my Python code, do I have to increment its refcount:
return Py_BuildValue("O", seq);

Or do I leave it alone and say:
return seq;

Thanks in advance.



More information about the Python-list mailing list