[New-bugs-announce] [issue29813] PyTuple_GetSlice documentation incorrect

Michael Seifert report at bugs.python.org
Tue Mar 14 22:40:50 EDT 2017


New submission from Michael Seifert:

The PyTuple_GetSlice documentation says it "Take a slice of the tuple pointed to by p from low to high and return it as a new tuple." [0] However in case the start is <= 0 and the stop is >= tuplesize it doesn't return the promised "new tuple", it just returns the tuplepointer after incrementing it's refcount [1].

The behaviour is fine (it gave me a bit of a headache though), however could a note/warning/sentence be included in the docs mentioning that special case?

[0] https://docs.python.org/3/c-api/tuple.html#c.PyTuple_GetSlice
[1] https://github.com/python/cpython/blob/master/Objects/tupleobject.c#L414

----------
assignee: docs at python
components: Documentation
messages: 289632
nosy: MSeifert, docs at python
priority: normal
severity: normal
status: open
title: PyTuple_GetSlice documentation incorrect
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29813>
_______________________________________


More information about the New-bugs-announce mailing list