On 2019-03-06, Hugh Fisher wrote:
So as a first step, we should add a typedef for PyHandle to Python.h (well, most likely within object.h) and macros defined for all or the most common object / type struct members.
I would prefer to make a separate Python extension module interface project (aka a shim layer). So, instead of compiling your extension module against the CPython source and headers, you would compile using the shim. That way, we can experiment and more easily change our mind about the API. People will be annoyed if we do experiments inside Python.h.
If I had unlimited resources, I would try to convert a bunch of extension modules to use that shim layer. You would quickly find out how difficult it is to change the source code for the extensions (must be easy to do) and what breaks due to API behavior changes (e.g. if we decide not to give one-to-one handle/object correspondence).
Regards,
Neil