New submission from Antony Lee <[email protected]>:
Unlike `PySequence_GetItem`, `PyTuple_GetItem` does not support negative
indices ("indexing from the end"). That is fine, but warrants a notice in the
docs (as that behavior is certainly not obvious).
The same wording as for `PyList_GetItem` (changing "list" to "tuple") should be
good enough (`PyList_GetItem` currently states: "The 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 IndexError
exception.")
----------
assignee: docs@python
components: C API, Documentation
messages: 381716
nosy: Antony.Lee, docs@python
priority: normal
severity: normal
status: open
title: Indicate in the docs that PyTuple_GetItem does not support negative
indices
versions: Python 3.10
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42451>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com