PyList_SetItem

WARNING: PyList_SetItem does not increment the new item's reference count, but does decrement the reference count of the item it replaces, if not nil. It does *decrement* the reference count if it is *not* inserted in the list. Similarly, PyList_GetItem does not increment the returned item's reference count.

  1. PyObject_BorrowedRef* PyList_GetItem(PyObject*, Py_ssize_t)
  2. int PyList_SetItem(PyObject*, Py_ssize_t, PyObject*)
    extern (C)
    int
    PyList_SetItem

Meta