
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@python components: Documentation messages: 289632 nosy: MSeifert, docs@python priority: normal severity: normal status: open title: PyTuple_GetSlice documentation incorrect type: behavior _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29813> _______________________________________