Serhiy Storchaka added the comment: 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. ---------- priority: normal -> high Added file: http://bugs.python.org/file46388/slice_get_indices_3.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27867> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com