cpython/Include
Victor Stinner 61381d7da1
gh-89653: PEP 670: Functions don't cast pointers (#91697)
In the limited C API version 3.11 and newer, the following functions
no longer cast their object pointer argument with _PyObject_CAST() or
_PyObject_CAST_CONST():

* Py_REFCNT(), Py_TYPE(), Py_SIZE()
* Py_SET_REFCNT(), Py_SET_TYPE(), Py_SET_SIZE()
* Py_IS_TYPE()
* Py_INCREF(), Py_DECREF()
* Py_XINCREF(), Py_XDECREF()
* Py_NewRef(), Py_XNewRef()
* PyObject_TypeCheck()
* PyType_Check()
* PyType_CheckExact()

Split Py_DECREF() implementation in 3 versions to make the code more
readable.

Update the xxlimited.c extension, which uses the limited C API
version 3.11, to pass PyObject* to these functions.
2022-04-26 00:11:34 +02:00
..
cpython gh-89653: PEP 670: Functions don't cast pointers (#91697) 2022-04-26 00:11:34 +02:00
internal gh-91768: C API no longer use "const PyObject*" type (#91769) 2022-04-21 22:07:19 +02:00
abstract.h
bltinmodule.h
boolobject.h
bytearrayobject.h
bytesobject.h
ceval.h
codecs.h
compile.h
complexobject.h bpo-35134: Add Include/cpython/complexobject.h header (GH-32383) 2022-04-07 01:05:27 +02:00
datetime.h
descrobject.h
dictobject.h
dynamic_annotations.h
enumobject.h
errcode.h
exports.h
fileobject.h
fileutils.h
floatobject.h
frameobject.h
genericaliasobject.h
import.h
intrcheck.h
iterobject.h
listobject.h
longobject.h
marshal.h
memoryobject.h
methodobject.h bpo-47164: Add _PyCFunction_CAST() macro (GH-32192) 2022-03-31 10:02:34 +02:00
modsupport.h gh-79315: Add Include/cpython/modsupport.h header (#91797) 2022-04-21 23:00:26 +02:00
moduleobject.h
object.h gh-89653: PEP 670: Functions don't cast pointers (#91697) 2022-04-26 00:11:34 +02:00
objimpl.h
opcode.h GH-91719: Make MSVC generate somewhat faster switch code (#91718) 2022-04-21 11:53:57 -07:00
osdefs.h
osmodule.h
patchlevel.h Post 3.11.0a7 2022-04-05 21:10:38 +01:00
py_curses.h
pybuffer.h
pycapsule.h
pydtrace.d
pydtrace.h
pyerrors.h gh-90501: Add PyErr_GetHandledException and PyErr_SetHandledException (GH-30531) 2022-04-15 19:57:47 +01:00
pyexpat.h
pyframe.h
pyhash.h
pylifecycle.h
pymacconfig.h
pymacro.h gh-91782: Define static_assert() macro on FreeBSD (#91787) 2022-04-21 16:40:34 +02:00
pymath.h
pymem.h
pyport.h bpo-43166: Disable ceval.c optimizations for Windows debug builds (GH-32023) 2022-03-23 00:35:25 +00:00
pystate.h
pystrcmp.h
pystrtod.h bpo-45995: add "z" format specifer to coerce negative 0 to zero (GH-30049) 2022-04-11 15:34:18 +01:00
Python.h bpo-35134: Remove the Include/code.h header file (GH-32385) 2022-04-07 02:29:52 +02:00
pythonrun.h Docs: Clarify availability of PyOS_CheckStack (GH-91816) 2022-04-22 12:44:43 +02:00
pythread.h gh-79315: Add Include/cpython/pythread.h header (#91798) 2022-04-21 23:00:42 +02:00
pytypedefs.h
rangeobject.h
README.rst
setobject.h bpo-35134: Add Include/cpython/setobject.h header (GH-32384) 2022-04-07 01:26:24 +02:00
sliceobject.h
structmember.h
structseq.h
sysmodule.h
token.h
traceback.h
tracemalloc.h
tupleobject.h
typeslots.h
unicodeobject.h bpo-47164: Add _PyASCIIObject_CAST() macro (GH-32191) 2022-03-31 09:59:27 +02:00
warnings.h
weakrefobject.h

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

The C API is divided into three sections:

1. ``Include/``: Limited API
2. ``Include/cpython/``: CPython implementation details
3. ``Include/internal/``: 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/