PyList_SET_ITEM- an unsafe macro that basically binds an object to an internal array of list pointers without any border checks. If something is not NULLin the iith position of the list, a reference leak will occur. PyList_SET_ITEMsteals a link to the object that you entered in the list. PyList_SetItemalso steals the link, but checks the borders and decrees for everything that may be in the ith position. The rule of thumb is to use PyList_SET_ITEMto initialize the lists you just created, and PyList_SetItemotherwise. It is also completely safe to use PyList_SetItemeverywhere; PyList_SET_ITEM- This is basically a hacking speed.
source
share