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 scoder
Recipients mark.dickinson, pitrou, scoder, serhiy.storchaka
Date 2014-11-16.08:17:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1416125832.69.0.293465584267.issue18813@psf.upfronthosting.co.za>
In-reply-to
Content
Here's another idea. There could be two implementations of "slice", one that uses Python object indices (as currently) and one that has Py_ssize_t indices  (and properties for the start/stop/step attributes). Similar to what Unicode strings do, the slice type would decide which to use at instantiation time.

The internals of PySliceObject are not part of the stable ABI, and the normal way to figure out the indices is PySlice_GetIndicesEx(), which would be adapted accordingly.

This breaks compatibility with some C extensions that access the slice attributes directly, but that should be rare, given how complex index calculations are.

This change is certainly more invasive than adding Py_ssize_t fields to the existing object, though.
History
Date User Action Args
2014-11-16 08:17:12scodersetrecipients: + scoder, mark.dickinson, pitrou, serhiy.storchaka
2014-11-16 08:17:12scodersetmessageid: <1416125832.69.0.293465584267.issue18813@psf.upfronthosting.co.za>
2014-11-16 08:17:12scoderlinkissue18813 messages
2014-11-16 08:17:12scodercreate