cpython/Include
Miss Islington (bot) c72699086f
Some checks are pending
Tests / Windows MSI (push) Blocked by required conditions
Tests / (push) Blocked by required conditions
Tests / Change detection (push) Waiting to run
Tests / Docs (push) Blocked by required conditions
Tests / Check if the ABI has changed (push) Blocked by required conditions
Tests / Check if Autoconf files are up to date (push) Blocked by required conditions
Tests / WASI (push) Blocked by required conditions
Tests / Check if generated files are up to date (push) Blocked by required conditions
Tests / Hypothesis tests on Ubuntu (push) Blocked by required conditions
Tests / Ubuntu SSL tests with OpenSSL (push) Blocked by required conditions
Tests / Address sanitizer (push) Blocked by required conditions
Tests / Cross build Linux (push) Blocked by required conditions
Tests / CIFuzz (push) Blocked by required conditions
Tests / All required checks pass (push) Blocked by required conditions
Lint / lint (push) Waiting to run
[3.14] gh-135906: Use _PyObject_CAST in internal headers (GH-135892) (GH-136392)
gh-135906: Use `_PyObject_CAST` in internal headers (GH-135892)

Fixes build errors encountered in python-greenlet/greenlet#450 when building greenlet on the free-threaded build.

---------
(cherry picked from commit fe187fae8d)

Co-authored-by: Charlie Lin <tuug@gmx.us>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-07-07 17:21:28 +00:00
..
cpython [3.14] gh-135755: Use private names (_Py*) for header file guards new in 3.14 (GH-135921) (GH-135976) 2025-07-01 12:37:02 +02:00
internal [3.14] gh-135906: Use _PyObject_CAST in internal headers (GH-135892) (GH-136392) 2025-07-07 17:21:28 +00:00
abstract.h [3.14] gh-134989: Implement PyObject_DelAttr() as a macro in the limited C API (GH-135021) (#135133) 2025-06-04 13:33:20 +00:00
audit.h [3.14] gh-135755: Use private names (_Py*) for header file guards new in 3.14 (GH-135921) (GH-135976) 2025-07-01 12:37:02 +02:00
bltinmodule.h
boolobject.h [3.14] gh-134989: Fix Py_RETURN_NONE in the limited C API (GH-135165) (#135178) 2025-06-05 15:35:54 +02:00
bytearrayobject.h
bytesobject.h gh-108765: Move standard includes to Python.h (#108769) 2023-09-01 21:03:20 +02:00
ceval.h [3.14] gh-135755: Move SPECIAL_ constants to a private header (GH-135922) (GH-135926) 2025-06-25 13:36:46 +02:00
codecs.h
compile.h gh-109596: Ensure repeated rules in the grammar are not allowed and fix incorrect soft keywords (#109606) 2023-09-22 19:03:23 +01:00
complexobject.h
critical_section.h gh-119344: Make critical section API public (#119353) 2024-06-21 15:50:18 -04:00
datetime.h
descrobject.h
dictobject.h gh-106004: PyDict_GetItemRef() should only be in the limited API 3.13 (GH-107229) 2023-07-25 21:48:07 +03:00
dynamic_annotations.h
enumobject.h
errcode.h gh-107450: Check for overflow in the tokenizer and fix overflow test (#110832) 2023-10-16 16:42:49 +02:00
exports.h gh-121040: Use __attribute__((fallthrough)) (#121044) 2024-06-27 09:58:44 +00:00
fileobject.h gh-106320: Remove _PyIsSelectable_fd() C API (#107142) 2023-07-23 19:07:12 +00:00
fileutils.h gh-108765: Move stat() fiddling from pyport.h to fileutils.h (#108854) 2023-09-03 21:32:13 +00:00
floatobject.h gh-120026: soft deprecate Py_HUGE_VAL macro (#120027) 2024-11-01 22:04:31 +00:00
frameobject.h
genericaliasobject.h
import.h
intrcheck.h gh-106320: Remove private _PyOS_IsMainThread() function (#108605) 2023-08-29 03:20:31 +00:00
iterobject.h gh-106320: Remove _PyAnextAwaitable_Type from the public C API (#108597) 2023-08-29 02:05:11 +00:00
listobject.h gh-114329: Fix PyList_GetItemRef() limited C API definition (#117520) 2024-04-03 21:02:42 +00:00
lock.h gh-117511: Make PyMutex public in the non-limited API (#117731) 2024-06-20 11:29:08 -04:00
longobject.h gh-132639: Adds PyLong_AsNativeBytes, PyLong_FromNativeBytes and PyLong_FromUnsignedNativeBytes to the limited API (GH-132640) 2025-04-21 15:59:03 +01:00
marshal.h gh-125063: marshal: Add version 5, improve documentation (GH-126829) 2024-11-15 13:48:57 +01:00
memoryobject.h
methodobject.h gh-132097: use a macro for semantically casting function pointers (#132406) 2025-04-18 12:24:34 +02:00
modsupport.h gh-112136: Restore removed _PyArg_Parser (#121262) 2024-07-03 18:36:57 +02:00
moduleobject.h gh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL (GH-118645) 2024-05-06 18:59:36 +02:00
monitoring.h gh-111997: C-API for signalling monitoring events (#116413) 2024-05-04 08:23:50 +00:00
object.h [3.14] gh-134989: Fix Py_RETURN_NONE in the limited C API (GH-135165) (#135178) 2025-06-05 15:35:54 +02:00
objimpl.h gh-102013: Move PyUnstable_GC_VisitObjects() to Include/cpython/objimpl.h (#115560) 2024-02-16 15:49:13 +01:00
opcode.h gh-100239: replace BINARY_SUBSCR & family by BINARY_OP with oparg NB_SUBSCR (#129700) 2025-02-07 22:39:54 +00:00
opcode_ids.h gh-100239: specialize BINARY_OP/SUBSCR for list-slice (#132626) 2025-05-01 10:28:52 +00:00
osdefs.h gh-108765: Reformat Include/osdefs.h (#108766) 2023-09-01 14:35:39 +00:00
osmodule.h
patchlevel.h Post 3.14.0b3 2025-06-17 21:31:06 +03:00
py_curses.h bpo-44172: Keep reference to original window in curses subwindow objects (GH-26226) 2025-05-04 13:29:44 +03:00
pyatomic.h gh-108724: Add PyMutex and _PyParkingLot APIs (gh-109344) 2023-09-19 09:54:29 -06:00
pybuffer.h
pycapsule.h gh-108240: Add pycore_capsule.h internal header file (#108596) 2023-08-29 01:20:02 +00:00
pydtrace.d
pydtrace.h
pyerrors.h gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from public API/ABI (GH-119680) 2024-06-24 14:08:12 +02:00
pyexpat.h gh-115398: Revert PyExpat_CAPI_MAGIC version bump (GH-116411) 2024-03-06 09:55:07 -08:00
pyframe.h
pyhash.h gh-111545: Add Include/cpython/pyhash.h header file (#112063) 2023-11-15 01:19:20 +01:00
pylifecycle.h gh-117987: Restore several functions removed in Python 3.13 alpha 1 (GH-117993) 2024-04-18 15:20:38 +02:00
pymacconfig.h gh-110820: Make sure processor specific defines are correct for Universal 2 build on macOS (#112828) 2023-12-08 10:09:34 +01:00
pymacro.h gh-128972: Add _Py_ALIGN_AS and revert PyASCIIObject memory layout. (GH-133085) 2025-05-02 18:30:40 +02:00
pymath.h gh-120026: soft deprecate Py_HUGE_VAL macro (#120027) 2024-11-01 22:04:31 +00:00
pymem.h gh-85283: Add PyMem_RawMalloc() to the limited C API (#108570) 2023-10-17 02:41:51 +02:00
pyport.h gh-133256: Add _Py_NONSTRING macro (#133257) 2025-05-01 17:55:49 +02:00
pystate.h gh-108867: Add PyThreadState_GetUnchecked() function (#108870) 2023-10-03 16:53:51 +00:00
pystats.h GH-124284: Add stats for refcount operations on immortal objects (GH-124288) 2024-09-23 19:10:55 +01:00
pystrcmp.h
pystrtod.h gh-106320: Remove private float C API functions (#108430) 2023-08-24 19:09:49 +02:00
Python.h [3.14] gh-133779: Revert Windows generation of pyconfig.h and go back to a static header. (GH-133966) 2025-05-19 21:24:53 +01:00
pythonrun.h [3.14] gh-130396: Move PYOS_LOG2_STACK_MARGIN to internal headers (GH-135928) (#136173) 2025-07-01 13:44:32 +00:00
pythread.h gh-87135: Hang non-main threads that attempt to acquire the GIL during finalization (GH-105805) 2024-10-02 09:17:49 -07:00
pytypedefs.h
rangeobject.h
README.rst
refcount.h [3.14] gh-127705: Move Py_INCREF_MORTAL() to the internal C API (GH-136178) (#136206) 2025-07-03 06:42:17 +00:00
setobject.h
sliceobject.h gh-115754: Add Py_GetConstant() function (#116883) 2024-03-21 16:07:00 +00:00
structmember.h Fix typos in comments (#120188) 2024-06-07 10:19:41 +02:00
structseq.h
sysmodule.h gh-125604: Move _Py_AuditHookEntry, etc. Out of pycore_runtime.h (gh-125605) 2024-10-18 09:26:08 -06:00
traceback.h
tupleobject.h
typeslots.h Revert "gh-133395: add option for extension modules to specialize BINARY_OP/SUBSCR, apply to arrays (#133396)" (#133498) 2025-05-06 13:12:26 +03:00
unicodeobject.h gh-132798: Schedule removal of PyUnicode_AsDecoded/Encoded functions for 3.15 (#132799) 2025-04-25 15:07:41 +02:00
warnings.h
weakrefobject.h gh-105927: Limit PyWeakref_GetRef() to limited C API 3.13 (#117091) 2024-03-20 23:52:23 +01:00

The Python C API
================

The C API is divided into these sections:

1. ``Include/``: Limited API
2. ``Include/cpython/``: CPython implementation details
3. ``Include/cpython/``, names with the ``PyUnstable_`` prefix: API that can
   change between minor releases
4. ``Include/internal/``, and any name with ``_`` prefix: The internal API

Information on changing the C API is available `in the developer guide`_

.. _in the developer guide: https://devguide.python.org/c-api/