[Python-Dev] Experiment an opt-in new C API for Python? (leave current API unchanged)

Antoine Pitrou solipsis at pitrou.net
Mon Nov 19 04:50:58 EST 2018


On Sun, 18 Nov 2018 16:53:19 +0100
Stefan Behnel <stefan_ml at behnel.de> wrote:
> 
> So, in Cython, we use macros wherever possible, and often avoid generic
> protocols in favour of type specialisations. We sometimes keep local copies
> of C-API helper functions, because inlining them allows the C compiler to
> strip down and streamline the implementation at compile time, rather than
> jumping through generic code. (Also, it's sometimes required in order to
> backport new CPython features to Py2.7+.)

Also this approach allows those ballooning compile times that are part
of Cython's charm and appeal ;-)
(sorry, couldn't resist)

Regards

Antoine.




More information about the Python-Dev mailing list