mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
bpo-37487: Fix PyList_GetItem index description. (GH-14623)
0 is a legal index.
This commit is contained in:
parent
fcf1d003bf
commit
f8709e804d
2 changed files with 4 additions and 3 deletions
|
@ -59,9 +59,9 @@ List Objects
|
||||||
.. c:function:: PyObject* PyList_GetItem(PyObject *list, Py_ssize_t index)
|
.. c:function:: PyObject* PyList_GetItem(PyObject *list, Py_ssize_t index)
|
||||||
|
|
||||||
Return the object at position *index* in the list pointed to by *list*. The
|
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
|
position must be non-negative; indexing from the end of the list is not
|
||||||
supported. If *index* is out of bounds, return *NULL* and set an
|
supported. If *index* is out of bounds (<0 or >=len(list)),
|
||||||
:exc:`IndexError` exception.
|
return *NULL* and set an :exc:`IndexError` exception.
|
||||||
|
|
||||||
|
|
||||||
.. c:function:: PyObject* PyList_GET_ITEM(PyObject *list, Py_ssize_t i)
|
.. c:function:: PyObject* PyList_GET_ITEM(PyObject *list, Py_ssize_t i)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Fix PyList_GetItem index description to include 0.
|
Loading…
Add table
Add a link
Reference in a new issue