My plan for Cython is to provide the full C API, the API used by CPython core and builtin modules. But it should be an opt-in option, rather than the default, as we do currently.
At the ABI level, I'm not sure if we can hide some functions for regular C extensions, but only give access to Cython? Maybe the names should be mangled to make sure that no mistake is done? For *example*, keep PyTuple_GetItem() function available, but as a different symbol like: _PyTuple_GetItem()?
For the consumer of the C API, the cost of using the full C API is to loose the stable ABI and have to adapt the code for each Python release (3.x)... Well, exactly what we do have currently.
Obviously, Cython is heavily tied to CPython internals. If CPython internals evolve to implement some optimizations, Cython will be broken. But I prefer to see what's going on, rather than making an assumptions.
Note: My goal is not to kill Cython :-) Working Cython and numpy is an important target for me.
Victor Le ven. 7 sept. 2018 à 15:09, Stefan Behnel <python_capi@behnel.de> a écrit :
On 07.09.2018 11:46, Victor Stinner wrote:
I'm trying to remove functions from the C API which allow to do things which are not possible at the Python level: https://pythoncapi.readthedocs.io/bad_api.html#no-public-c-functions-if-it-c...
Sorry – no way. Cython can definitely make very good use of those internals, shortcuts, and what not. If you want them removed, then please replace them with something equivalent that doesn't reduce the performance.
Stefan
capi-sig mailing list -- capi-sig@python.org To unsubscribe send an email to capi-sig-leave@python.org