On Wed, Dec 19, 2018 at 2:18 PM M.-A. Lemburg <mal@egenix.com> wrote:
I did not say that it isn't used, but the effort it takes to maintain it and keep it working does not match up to the few gains it has for a few extension writers.
If you search for "Py_LIMITED_API" on Google, you get less then 4000 hits. Many of those are related to issues with the limited API, e.g.
https://bitbucket.org/cffi/cffi/issues/350/issue-with-py_limited_api-on-wind...
If you search for '"#define Py_LIMITED_API"' you get around 100 hits.
It is not a widely used feature of the Python C API.
From one perspective, the limited API is just a subset of the existing API. It includes most of the symbols in the API and excludes a few like PyType_Ready. When there is a replacement, like PyType_FromSpec is for PyType_Ready, the user does not have to define Py_LIMITED_API in order to use it.
Many extensions are effectively clients of the limited API by using the new APIs it provides or by not using symbols that are not part of the limited API. As a consequence, measuring the usage of the API by the definition of Py_LIMITED_API seems to exclude such clients of the limited API.
I am curious if you could elaborate on what aspect of the limited API you are referring to in these statements, especially regarding maintenance. Are you concerned about the effort to leave that in macro in the API headers, or some other maintenance cost beyond maintaining the macro?