Hi,

I noticed the following changes in the C API manuals from 3.3.5 (and earlier 
versions) to 3.4. I don't know if these changes are deliberate and imply that 
we C extension developers no longer need to care about 'reference ownership' 
because of some improvements in 3.4. Could anyone clarify it?

Thanks,
Jianfeng


--- 3.4  C API  reference manual ----
PyObject<https://docs.python.org/3/c-api/structures.html#c.PyObject>* 
PySequence_GetItem(PyObject<https://docs.python.org/3/c-api/structures.html#c.PyObject>
 *o, Py_ssize_t 
i)¶<https://docs.python.org/3/c-api/sequence.html#c.PySequence_GetItem>

Return the ith element of o, or NULL on failure. This is the equivalent of the 
Python expression o[i].
PyObject<https://docs.python.org/3.4/c-api/structures.html#c.PyObject>* 
PyList_GetItem(PyObject<https://docs.python.org/3.4/c-api/structures.html#c.PyObject>
 *list, Py_ssize_t index)

Return the object at position index in the list pointed to by list. The 
position must be positive, indexing from the end of the list is not supported. 
If index is out of bounds, return NULL and set an 
IndexError<https://docs.python.org/3.4/library/exceptions.html#IndexError> 
exception.

--- 3.3.5 C API reference manual ---
PyObject<https://docs.python.org/3.3/c-api/structures.html#PyObject>* 
PySequence_GetItem(PyObject<https://docs.python.org/3.3/c-api/structures.html#PyObject>
 *o, Py_ssize_t 
i)¶<https://docs.python.org/3.3/c-api/sequence.html#PySequence_GetItem>
Return value: New reference.

Return the ith element of o, or NULL on failure. This is the equivalent of the 
Python expression o[i].

PyObject<https://docs.python.org/3.3/c-api/structures.html#PyObject>* 
PyList_GetItem(PyObject<https://docs.python.org/3.3/c-api/structures.html#PyObject>
 *list, Py_ssize_t index)
Return value: Borrowed reference.

Return the object at position index in the list pointed to by list. The 
position must be positive, indexing from the end of the list is not supported. 
If index is out of bounds, return NULL and set an 
IndexError<https://docs.python.org/3.3/library/exceptions.html#IndexError> 
exception.

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to