This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author MSeifert
Recipients MSeifert, docs@python
Date 2017-03-15.02:40:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489545650.77.0.905284505898.issue29813@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2017-03-15 02:40:50MSeifertsetrecipients: + MSeifert, docs@python
2017-03-15 02:40:50MSeifertsetmessageid: <1489545650.77.0.905284505898.issue29813@psf.upfronthosting.co.za>
2017-03-15 02:40:50MSeifertlinkissue29813 messages
2017-03-15 02:40:49MSeifertcreate