PyList_New

S

soso

Hi everybody,

Does PyList_New() increments the reference count? I believe yes but I
want to be sure because I saw some code from a module that has a
function that increments it before returning the list.

Thanks in advance,
soso
 
R

Raymond Hettinger

[soso]
Hi everybody,
Hello!


Does PyList_New() increments the reference count?
Yes.


I believe yes but I
want to be sure because I saw some code from a module that has a
function that increments it before returning the list.

Quoth the docs:
"""
PyObject* PyList_New( int len)

Return value: New reference.
Returns a new list of length len on success, or NULL on failure.
"""

Thanks in advance,

You're welcome after the fact.



Raymond Hettinger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top