Author: Devin Jeanpierre <[email protected]>
Branch: 
Changeset: r83926:25a54857f693
Date: 2016-04-26 10:53 -0700
http://bitbucket.org/pypy/pypy/changeset/25a54857f693/

Log:    Correct the return type and documentation of PyList_SET_ITEM.

diff --git a/pypy/module/cpyext/listobject.py b/pypy/module/cpyext/listobject.py
--- a/pypy/module/cpyext/listobject.py
+++ b/pypy/module/cpyext/listobject.py
@@ -21,7 +21,8 @@
     """
     return space.newlist([None] * len)
 
-@cpython_api([PyObject, Py_ssize_t, PyObject], rffi.INT_real, 
error=CANNOT_FAIL)
+@cpython_api([PyObject, Py_ssize_t, PyObject], PyObject, error=CANNOT_FAIL,
+             result_borrowed=True)
 def PyList_SET_ITEM(space, w_list, index, w_item):
     """Macro form of PyList_SetItem() without error checking. This is normally
     only used to fill in new lists where there is no previous content.
@@ -36,7 +37,7 @@
     make_ref(space, w_list.getitem(index))
     Py_DecRef(space, w_item)
     w_list.setitem(index, w_item)
-    return 0
+    return w_item
 
 
 @cpython_api([PyObject, Py_ssize_t, PyObject], rffi.INT_real, error=-1)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to