Skip to content

Commit

Permalink
bpo-37487: Fix PyList_GetItem index description. (pythonGH-14623)
Browse files Browse the repository at this point in the history
0 is a legal index.
  • Loading branch information
terryjreedy committed Jul 6, 2019
1 parent fcf1d00 commit f8709e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Doc/c-api/list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix PyList_GetItem index description to include 0.

0 comments on commit f8709e8

Please sign in to comment.