I think this discussion is a bit misleading. Cython allows you to wrap existing C code, but if you want to use Python objects in C or details which are not exposed at the Python level, you still need the Python C API to work with those.
Please don't forget that the Python C API was key in making it so popular for integration. It's generally a very nice API to work with as C programmer.
There are also plenty other tools for wrapping C or C++ or Java code out there. Some work as compilers or code generators, others using an interfacing layer and dynamic introspection. Each fills a niche and is good for specific use cases.
Whether to use Cython or not depends on your use case. It's not always the obvious choice (otherwise, those other tools would not exist).
I'm not saying that the Python C API doesn't have warts or issues, but limiting its usefulness or ditching it completely is not the answer. Of course, it has to evolve just like Python itself does.
On 07.09.2018 10:25, Victor Stinner wrote:
I never used Cython, so I'm not the good candidate to explain when Cython is appropriate: for which kind of use cases. Is there any volunteer to fill the https://pythoncapi.readthedocs.io/cython.html page?
Maybe Stefan Behnel? :-)
Victor Le mar. 31 juil. 2018 à 18:01, Eric Snow email@example.com a écrit :
Not that long ago Brett, Barry, and I were talking about how to get extension authors to move away from the C-API. Cython is the obvious choice, but it isn't an official tool nor does it necessarily make sense to make it one. Regardless, it would help all parties involved if there *were* an official tool that was part of CPython (i.e. in the repo). Cython could build on top of it and extension authors would be encouraged to use it or Cython. If such a thing makes sense, I figure we would follow the pattern set by asyncio (relative to twisted).