Issue 1464658: PyList_GetItem() clarification - Python tracker (original) (raw)

Issue1464658

Created on 2006-04-05 03:38 by stefan, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg28090 - (view) Author: Stefan Seefeld (stefan) * (Python committer) Date: 2006-04-05 03:38
The PyList_GetItem function is documented at http://docs.python.org/api/listObjects.html as returning "...the object at position pos...". However, even though in python -1 is a valid index, this function expects a 'real' index. 1) I believe it would be worthwhile pointing out in the API docs that in fact a positive value is expected. 2) It would be good to change the function signature to expect an unsigned int instead of an int for the index.
msg28091 - (view) Author: Matt Fleming (splitscreen) Date: 2006-04-05 11:59
Logged In: YES user_id=1126061 I agree with these suggestions. It's not impossible for someone to 'just assume' a negative index is handled correctly by PyList_GetItem(). +1
msg28092 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-04-06 12:46
Logged In: YES user_id=849994 Thanks! Fixed in rev. 43704, 43705.
History
Date User Action Args
2022-04-11 14:56:16 admin set github: 43160
2006-04-05 03:38:23 stefan create