PyList_GetItem

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)
    extern (C)
    PyObject_BorrowedRef*
    PyList_GetItem
  2. int PyList_SetItem(PyObject*, Py_ssize_t, PyObject*)

Meta