cpython/Include
Brett Simmers f8290df63f
gh-116738: Make _codecs module thread-safe (#117530)
The module itself is a thin wrapper around calls to functions in
`Python/codecs.c`, so that's where the meaningful changes happened:

- Move codecs-related state that lives on `PyInterpreterState` to a
  struct declared in `pycore_codecs.h`.

- In free-threaded builds, add a mutex to `codecs_state` to synchronize
  operations on `search_path`. Because `search_path_mutex` is used as a
  normal mutex and not a critical section, we must be extremely careful
  with operations called while holding it.

- The codec registry is explicitly initialized as part of
  `_PyUnicode_InitEncodings` to simplify thread-safety.
2024-05-02 18:25:36 -04:00
..
cpython gh-93502: Add new C-API functions to trace object creation and destruction (#115945) 2024-05-02 19:30:00 +02:00
internal gh-116738: Make _codecs module thread-safe (#117530) 2024-05-02 18:25:36 -04:00
abstract.h gh-108511: Add C API functions which do not silently ignore errors (GH-109025) 2023-09-17 14:23:31 +03:00
bltinmodule.h
boolobject.h gh-115754: Add Py_GetConstant() function (#116883) 2024-03-21 16:07:00 +00:00
bytearrayobject.h
bytesobject.h
ceval.h gh-117929: Restore removed PyEval_InitThreads() function (#117931) 2024-04-17 15:01:28 +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
datetime.h
descrobject.h
dictobject.h
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-108765: Move export code from pyport.h to exports.h (#108855) 2023-09-04 01:04:05 +02:00
fileobject.h
fileutils.h
floatobject.h
frameobject.h
genericaliasobject.h
import.h
intrcheck.h
iterobject.h
listobject.h gh-114329: Fix PyList_GetItemRef() limited C API definition (#117520) 2024-04-03 21:02:42 +00:00
longobject.h gh-117021: Fix integer overflow in PyLong_AsPid() on non-Windows 64-bit platforms (GH-117064) 2024-03-20 15:39:53 +02:00
marshal.h
memoryobject.h
methodobject.h gh-114626: Add again _PyCFunctionFastWithKeywords name (GH-115561) 2024-02-19 13:20:46 +01:00
modsupport.h gh-65210: Add const qualifiers in PyArg_VaParseTupleAndKeywords() (GH-105958) 2023-12-04 13:14:56 +02:00
moduleobject.h gh-117953: Split Up _PyImport_LoadDynamicModuleWithSpec() (gh-118203) 2024-04-29 09:29:07 -06:00
object.h gh-117657: Fix race data race in _Py_IsOwnedByCurrentThread() (#118258) 2024-04-26 10:39:08 -04: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
opcode_ids.h gh-116381: Remove bad specializations, add fail stats (GH-116464) 2024-03-08 00:21:21 +08:00
osdefs.h
osmodule.h
patchlevel.h Post 3.13.0a6 2024-04-09 20:40:50 +02:00
py_curses.h
pyatomic.h gh-108724: Add PyMutex and _PyParkingLot APIs (gh-109344) 2023-09-19 09:54:29 -06:00
pybuffer.h
pycapsule.h
pydtrace.d
pydtrace.h
pyerrors.h gh-113744: Add a new IncompleteInputError exception to improve incomplete input detection in the codeop module (#113745) 2024-01-30 16:21:30 +00: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-118124: Use static_assert() in Py_BUILD_ASSERT() on C11 (#118398) 2024-04-30 22:29:48 +02:00
pymath.h
pymem.h gh-85283: Add PyMem_RawMalloc() to the limited C API (#108570) 2023-10-17 02:41:51 +02:00
pyport.h gh-112536: Define _Py_THREAD_SANITIZER on GCC when TSan is enabled (#117702) 2024-04-10 10:20:05 -04:00
pystate.h gh-108867: Add PyThreadState_GetUnchecked() function (#108870) 2023-10-03 16:53:51 +00:00
pystats.h gh-108753: Enhance pystats (#108754) 2023-09-06 15:54:59 +00:00
pystrcmp.h
pystrtod.h
Python.h gh-111506: Error if the limited API is used in free-threaded build (#117762) 2024-04-11 13:49:52 -04:00
pythonrun.h
pythread.h gh-81925: Implement native thread ids for kFreeBSD (#111761) 2023-11-09 21:02:30 +01:00
pytypedefs.h
rangeobject.h
README.rst
setobject.h
sliceobject.h gh-115754: Add Py_GetConstant() function (#116883) 2024-03-21 16:07:00 +00:00
structmember.h
structseq.h
sysmodule.h gh-117987: Restore several functions removed in Python 3.13 alpha 1 (GH-117993) 2024-04-18 15:20:38 +02:00
traceback.h
tupleobject.h
typeslots.h
unicodeobject.h gh-111089: Revert PyUnicode_AsUTF8() changes (#111833) 2023-11-07 22:36:13 +00: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/