PyList_New

Discussion in 'Python' started by soso, Aug 30, 2003.

  1. soso

    soso Guest

    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
    soso, Aug 30, 2003
    #1
    1. Advertising

  2. [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.


    > soso



    Raymond Hettinger
    Raymond Hettinger, Aug 30, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page