[Python-Dev] Make the stable API-ABI usable

Nick Coghlan ncoghlan at gmail.com
Sat Nov 18 08:58:46 EST 2017


On 18 November 2017 at 23:50, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On 18 November 2017 at 11:05, Victor Stinner <victor.stinner at gmail.com> wrote:
>> Hi,
>>
>> tl; dr I propose to extend the existing "stable API" to make it almost
>> as complete as the current API. For example, add back
>> PyTuple_GET_ITEM() to be stable API, but it becomes a function call
>> rather than a macro. The final question is if it's not too late to
>> iterate on an implementation of this idea for Python 3.7? Knowing that
>> the stable API doesn't affect the "current API" at all, since the "new
>> C API" (extended stable API) would only be accessible using an
>> *opt-in* flag.
>
> I'm -1 on expanding the stable API/ABI in 3.7 (especially without a
> PEP), but I'm +1 on refactoring the way we maintain it, with a view to
> expanding it (with function calls substituting in for the macros in
> Py_LIMITED_API mode) in 3.8.

Expanding on this concept: I think PEP 432 may be a reasonable model
here, whereby you can write a mostly-core-developer focused PEP that
sets out your vision for where you'd like to get to eventually, and
then that PEP provides context for issue-level refactorings that might
otherwise seem like code churn with no apparent purpose.

Each refactoring will still need to stand as beneficial on its own
(usually on grounds of code clarity, or otherwise making future
maintenance easier, even if it makes near term backports harder), but
that process tends to run more smoothly when there's a shared
understanding of the overarching goal.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list