.. _old-c-api: +++++++++ Old C API +++++++++ The "current" or "old" C API is the Python 3.7 API which "leaks" implementation details like ``PyObject.ob_refcnt`` through :ref:`Py_INCREF() ` macro. With the new C API, the old C API will remain available thanks to the :ref:`regular runtime `, for CPython internals, for specific use cases like :ref:`Cython ` (for best performances) and :ref:`debugging tools `, but also for the long tail of C extensions on PyPI. See also :ref:`Calling conventions `. What is the Python C API? ========================= * Python objects * Protocol, Abstract * Types, Classes * Memory Allocators * Python initialization and configuration * Control flow * Generator * Exception: ``PyErr_SetString()``, ``PyErr_Clear()`` Current Python C API ==================== * CPython: `headers of the Include/ directory `_ * PyPy :ref:`cpyext `: `pypy/module/cpyext/ `_ (`cpyext/stubs.py `_)