summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2019-07-06 21:40:27 (GMT)
committerGitHub <noreply@github.com>2019-07-06 21:40:27 (GMT)
commitf8709e804d16ec5d44b1d2f00d59a0f78df7b792 (patch)
tree083f3c7f7c566e42c0beaad49cfa11e07d88f425 /Doc/c-api
parentfcf1d003bf4f0100c9d0921ff3d70e1127ca1b71 (diff)
downloadcpython-f8709e804d16ec5d44b1d2f00d59a0f78df7b792.zip
cpython-f8709e804d16ec5d44b1d2f00d59a0f78df7b792.tar.gz
cpython-f8709e804d16ec5d44b1d2f00d59a0f78df7b792.tar.bz2
bpo-37487: Fix PyList_GetItem index description. (GH-14623)
0 is a legal index.
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/list.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/c-api/list.rst b/Doc/c-api/list.rst
index 279783a..dc90266 100644
--- a/Doc/c-api/list.rst
+++ b/Doc/c-api/list.rst
@@ -59,9 +59,9 @@ List Objects
.. 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
- 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
- :exc:`IndexError` exception.
+ position must be non-negative; indexing from the end of the list is not
+ supported. If *index* is out of bounds (<0 or >=len(list)),
+ return *NULL* and set an :exc:`IndexError` exception.
.. c:function:: PyObject* PyList_GET_ITEM(PyObject *list, Py_ssize_t i)