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 serhiy.storchaka
Recipients mark.dickinson, ncoghlan, serhiy.storchaka, tehybel, terry.reedy, vstinner
Date 2017-01-23.10:00:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
We can't just add API functions in maintained releases, because it will break the stable ABI. We can use them only when explicitly define the version of API.

Proposed patch for 3.6 and 3.7 adds public API functions PySlice_Unpack() and PySlice_AdjustIndices() and makes PySlice_GetIndicesEx() a macro if set Py_LIMITED_API to the version that supports new API. Otherwise PySlice_GetIndicesEx() becomes deprecated.

This doesn't break extensions compiled with older Python versions. Extensions compiled with new Python versions without limited API or with high API version are not compatible with older Python versions as expected, but have fixed the original issue. Compiling extensions with new Python versions with set low Py_LIMITED_API value will produce a deprecation warning.

Pay attention to names and signatures of new API. It would be hard to change it when it added.

I think this is the safest way. In 2.7 we should replace PySlice_GetIndicesEx() with a macro for internal use only if we want to fix an issue for builtins and preserve a binary compatibility.
Date User Action Args
2017-01-23 10:00:54serhiy.storchakasetrecipients: + serhiy.storchaka, terry.reedy, mark.dickinson, ncoghlan, vstinner, tehybel
2017-01-23 10:00:54serhiy.storchakasetmessageid: <>
2017-01-23 10:00:54serhiy.storchakalinkissue27867 messages
2017-01-23 10:00:54serhiy.storchakacreate