[Python-ideas] discouraging direct use of the C-API

Antoine Pitrou solipsis at pitrou.net
Wed May 6 18:57:15 CEST 2015


On Wed, 6 May 2015 10:23:09 -0600
Eric Snow <ericsnowcurrently at gmail.com>
wrote:
> A big blocker to making certain sweeping changes to CPython (e.g.
> ref-counting) is compatibility with the vast body of C extension
> modules out there that use the C-API.  While there are certainly
> drastic long-term solutions to that problem, there is one thing we can
> do in the short-term that would at least get the ball rolling.  We can
> put a big red note at the top of every page of the C-API docs that
> encourages folks to either use CFFI or Cython.

CFFI is only useful for a small subset of stuff people use the C API for
(mainly, thin wrappers around external libraries). Cython is a more
reasonable suggestion in this context.

I would advocate against red warning boxes. Warnings are for
potentially dangerous constructs, we use them mainly for security
issues. Adding a note and some pointers at the start of the C API docs
may be enough.

Regards

Antoine.




More information about the Python-ideas mailing list