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 <rep...@bugs.python.org>
<http://bugs.python.org/issue29813>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to