# C API and ABI Stability

除非有另外記錄於文件，Python 的 C API 被包含在向後相容性策略 PEP 387 中。大多數改動都是相容於原始碼的（通常只會增加新的 API）。更改現有 API 或刪除 API 僅在棄用期後或修復嚴重問題時進行。

CPython 的應用程式二進位介面 (Application Binary Interface, ABI) 在次要版本中是向前和向後相容的（如果它們以相同的方式編譯；請參閱下面的平台注意事項）。因此，為 Python 3.10.0 編譯的程式碼將能夠在 3.10.8 上運行，反之亦然，但 3.9.x 和 3.11.x 就需要分別編譯。

C API 有兩層級，有不同的穩定性期望：

- 不穩定 API，可能會在次要版本中發生變化，而沒有棄用階段。會在名稱中以 `PyUnstable` 前綴來標記。

- 受限 API，在多個次要版本之間相容。當有定義 `Py_LIMITED_API` 時，只有這個子集會從 `Python.h` 公開。

下面將更詳細地討論這些內容。

帶有底線前綴的名稱是私有 API (private API)，像是 `_Py_InternalState`，即使在補丁版本 (patch release) 中也可能被更改，不會另行通知。如果你需要使用這個 API，可以聯繫 CPython 開發者 並針對你的使用方法來討論是否新增公開的 API。

## 不穩定的 C API

任何以 `PyUnstable` 前綴命名的 API 都會公開 CPython 實作細節，並可能在每個次要版本中進行更改（例如從 3.9 到 3.10），而不會出現任何棄用警告。但是它不會在錯誤修復發布版本中發生變化（例如從 3.10.0 到 3.10.1）。

它通常用於專門的低階工具，例如偵錯器。

使用此 API 的專案應該要遵循 CPython 開發細節，並花費額外的力氣來針對這些變動來做調整。

## 穩定的應用程式二進位介面

為簡單起見，本文件討論擴充 (extension)，但受限 API 和穩定 ABI 在所有 API 使用方式中都以相同的方式運作 -- 例如在嵌入式 Python (embedding Python) 中。

### 受限 C API

Python 3.2 引入了受限 API (Limited API)，它是 Python C API 的一個子集。僅使用受限 API 的擴充可以只編譯一次就被載入於多個版本的 Python。受限 API 的內容列在下方。

Py_LIMITED_API

  在包含 `Python.h` 之前定義此巨集以選擇只使用受限 API，並挑選受限 API 版本。

  將 `Py_LIMITED_API` 定義為對應於你的擴充有支援的最低 Python 版本的 `PY_VERSION_HEX` 值。該擴充與從指定版本開始的所有 Python 3 版本之 ABI 相容，並且可以使用過去版本有引入的受限 API。

  與其直接使用 `PY_VERSION_HEX` 巨集，不如寫死 (hardcode) 最小次要版本（例如代表 Python 3.10 的 `0x030A0000`），以便在使用未來的 Python 版本進行編譯時仍保持穩定性。

  你還可以將 `Py_LIMITED_API` 定義為 `3`，這與 `0x03020000`（Python 3.2，引入了受限 API 的版本）相同。

### 穩定 ABI

為了實現它，Python 提供了一個穩定 ABI (Stable ABI)：一組將在各個 Python 3.x 版本之間保持 ABI 相容的符號。

備註

穩定 ABI 可以防止 ABI 問題，例如由於結構布局或函式簽名變化導致缺少符號或數據損壞的鏈接器 (linker) 錯誤。然而，Python 的其他變化可能會改變 行為 的擴充。有關詳細信息，請參閱 Python 的向後相容性政策 ( PEP 387)。

穩定 ABI 被包含在受限 API 中開放的符號，但也包含其他符號 - 例如，支援舊版受限 API 所必需的函式。

在 Windows 上，使用穩定 ABI 的擴充應該連接到 `python3.dll` 而不是特定版本的函式庫，例如 `python39.dll`。

在某些平台上，Python 將查找並加載以 `abi3` 標籤命名的共享函式庫檔案（例如 `mymodule.abi3.so`）。它不檢查此類擴充是否符合穩定的 ABI。確保的責任在使用者（或者打包工具）身上，例如使用 3.10+ 受限 API 建置的擴充不會為較低版本的 Python 所安裝。

穩定 ABI 中的所有函式都作為函式存在於 Python 的共享函式庫中，而不僅是作為巨集。這使得它們可被用於不使用 C 預處理器 (preprocessor) 的語言。

### 受限 API 範圍和性能

受限 API 的目標是允許使用完整的 C API 進行所有可能的操作，但可能會降低性能。

例如，雖然 `PyList_GetItem()` 可用，但它的「不安全」巨集變體 `PyList_GET_ITEM()` 為不可用。巨集運行可以更快，因為它可以依賴 list 物件的特定版本實作細節。

如果沒有定義 `Py_LIMITED_API`，一些 C API 函式將被嵌入或被替換為巨集。定義 `Py_LIMITED_API` 會禁用嵌入，從而隨著 Python 資料結構的改進而提高穩定性，但可能會降低性能。

透過省略 `Py_LIMITED_API` 定義，可以使用特定版本的 ABI 編譯受限 API 擴充。這可以提高該 Python 版本的性能，但會限制相容性。使用 `Py_LIMITED_API` 編譯將產生一個擴充，可以在特定版本的擴充不可用的地方發布 — 例如，用於即將發布的 Python 版本的預發布版本 (prerelease)。

### 受限 API 注意事項

請注意，使用 `Py_LIMITED_API` 進行編譯不完全保證程式碼符合受限 API 或穩定 ABI。`Py_LIMITED_API` 僅涵蓋定義，但 API 還包括其他議題，例如預期的語義 (semantic)。

`Py_LIMITED_API` 無法防範的一個問題是使用在較低 Python 版本中無效的引數來呼叫函式。例如一個開始接受 `NULL` 作為引數的函式。在 Python 3.9 中，`NULL` 現在代表選擇預設行為，但在 Python 3.8 中，引數將被直接使用，導致 `NULL` 取消參照 (dereference) 且崩潰 (crash)。類似的引數適用於結構 (struct) 的欄位。

另一個問題是，當有定義 `Py_LIMITED_API` 時，一些結構欄位目前不會被隱藏，即使它們是受限 API 的一部分。

出於這些原因，我們建議要以它支援的所有次要 Python 版本來測試擴充，並且最好使用最低版本進行建置。

我們也建議要查看所有使用過的 API 的文件，檢查它是否明確屬於受限 API。即使有定義 `Py_LIMITED_API`，一些私有聲明也會因為技術原因（或者甚至是無意地，例如臭蟲）而被公開出來。

另請注意，受限 API 不一定是穩定的：在 Python 3.8 中使用 `Py_LIMITED_API` 進行編譯意味著擴充將能以 Python 3.12 運行，但不一定能以 Python 3.12 編譯。特別是如果穩定 ABI 保持穩定，部分受限 API 可能會被棄用和刪除。

## 平台注意事項

ABI 穩定性不僅取決於 Python，還取決於使用的編譯器、低階函式庫和編譯器選項。出於穩定 ABI 的目的，這些細節定義了一個「平台」。它們通常取決於作業系統種類和處理器架構

每個特定的 Python 發布者都有責任確保特定平台上的所有 Python 版本都以不破壞穩定 ABI 的方式建置。`python.org` 和許多第三方發布者發布的 Windows 和 macOS 版本就是這種情況。

## ABI Checking

在 3.15.0a0 (unreleased) 版被加入.

Python includes a rudimentary check for ABI compatibility.

This check is not comprehensive. It only guards against common cases of incompatible modules being installed for the wrong interpreter. It also does not take platform incompatibilities into account. It can only be done after an extension is successfully loaded.

Despite these limitations, it is recommended that extension modules use this mechanism, so that detectable incompatibilities raise exceptions rather than crash.

Most modules can use this check via the `Py_mod_abi` slot and the `PyABIInfo_VAR` macro, for example like this:

    PyABIInfo_VAR(abi_info);

    static PyModuleDef_Slot mymodule_slots[] = {
       {Py_mod_abi, &abi_info},
       ...
    };

The full API is described below for advanced use cases.

int PyABIInfo_Check( PyABIInfo *info, const char *module_name)
  為 穩定 ABI 的一部分 自 3.15 版本開始.

  Verify that the given info is compatible with the currently running interpreter.

  Return 0 on success. On failure, raise an exception and return -1.

  If the ABI is incompatible, the raised exception will be `ImportError`.

  The module_name argument can be `NULL`, or point to a NUL-terminated UTF-8-encoded string used for error messages.

  Note that if info describes the ABI that the current code uses (as defined by `PyABIInfo_VAR`, for example), using any other Python C API may lead to crashes. In particular, it is not safe to examine the raised exception.

  在 3.15.0a0 (unreleased) 版被加入.

PyABIInfo_VAR(NAME)
  為 穩定 ABI 的一部分 自 3.15 版本開始.

  Define a static `PyABIInfo` variable with the given NAME that describes the ABI that the current code will use. This macro expands to:

      static PyABIInfo NAME = {
          1, 0,
          PyABIInfo_DEFAULT_FLAGS,
          PY_VERSION_HEX,
          PyABIInfo_DEFAULT_ABI_VERSION
      }

  在 3.15.0a0 (unreleased) 版被加入.

type PyABIInfo
  為 穩定 ABI 的一部分 （包含所有成員） 自 3.15 版本開始.
  uint8_t abiinfo_major_version

    The major version of `PyABIInfo`. Can be set to:

    - `0` to skip all checking, or

    - `1` to specify this version of `PyABIInfo`.

  uint8_t abiinfo_minor_version

    The major version of `PyABIInfo`. Must be set to `0`; larger values are reserved for backwards-compatible future versions of `PyABIInfo`.

  uint16_t flags

    This field is usually set to the following macro:

    PyABIInfo_DEFAULT_FLAGS

      Default flags, based on current values of macros such as `Py_LIMITED_API` and `Py_GIL_DISABLED`.

    Alternately, the field can be set to to the following flags, combined by bitwise OR. Unused bits must be set to zero.

    ABI variant -- one of:

    > PyABIInfo_STABLE

    >   Specifies that the stable ABI is used.

    > PyABIInfo_INTERNAL

    >   Specifies ABI specific to a particular build of CPython. Internal use only.

    Free-threading compatibility -- one of:

    > PyABIInfo_FREETHREADED

    >   Specifies ABI compatible with free-threading builds of CPython. (That is, ones compiled with `--disable-gil`; with `t` in `sys.abiflags`)

    > PyABIInfo_GIL

    >   Specifies ABI compatible with non-free-threading builds of CPython (ones compiled without `--disable-gil`).

  uint32_t build_version

    The version of the Python headers used to build the code, in the format used by `PY_VERSION_HEX`.

    This can be set to `0` to skip any checks related to this field. This option is meant mainly for projects that do not use the CPython headers directly, and do not emulate a specific version of them.

  uint32_t abi_version

    The ABI version.

    For the Stable ABI, this field should be the value of `Py_LIMITED_API` (except if `Py_LIMITED_API` is `3`; use Py_PACK_VERSION (3, 2) in that case).

    Otherwise, it should be set to `PY_VERSION_HEX`.

    It can also be set to `0` to skip any checks related to this field.

    PyABIInfo_DEFAULT_ABI_VERSION

      The value that should be used for this field, based on current values of macros such as `Py_LIMITED_API`, `PY_VERSION_HEX` and `Py_GIL_DISABLED`.

  在 3.15.0a0 (unreleased) 版被加入.

## 受限 API 的內容

目前，受限 API 包括以下項目：

- `PY_VECTORCALL_ARGUMENTS_OFFSET`

- `PyABIInfo`

- `PyABIInfo_Check()`

- `PyABIInfo_VAR`

- `PyAIter_Check()`

- `PyArg_Parse()`

- `PyArg_ParseTuple()`

- `PyArg_ParseTupleAndKeywords()`

- `PyArg_UnpackTuple()`

- `PyArg_VaParse()`

- `PyArg_VaParseTupleAndKeywords()`

- `PyArg_ValidateKeywordArguments()`

- `PyBaseObject_Type`

- `PyBool_FromLong()`

- `PyBool_Type`

- `PyBuffer_FillContiguousStrides()`

- `PyBuffer_FillInfo()`

- `PyBuffer_FromContiguous()`

- `PyBuffer_GetPointer()`

- `PyBuffer_IsContiguous()`

- `PyBuffer_Release()`

- `PyBuffer_SizeFromFormat()`

- `PyBuffer_ToContiguous()`

- `PyByteArrayIter_Type`

- `PyByteArray_AsString()`

- `PyByteArray_Concat()`

- `PyByteArray_FromObject()`

- `PyByteArray_FromStringAndSize()`

- `PyByteArray_Resize()`

- `PyByteArray_Size()`

- `PyByteArray_Type`

- `PyBytesIter_Type`

- `PyBytes_AsString()`

- `PyBytes_AsStringAndSize()`

- `PyBytes_Concat()`

- `PyBytes_ConcatAndDel()`

- `PyBytes_DecodeEscape()`

- `PyBytes_FromFormat()`

- `PyBytes_FromFormatV()`

- `PyBytes_FromObject()`

- `PyBytes_FromString()`

- `PyBytes_FromStringAndSize()`

- `PyBytes_Repr()`

- `PyBytes_Size()`

- `PyBytes_Type`

- `PyCFunction`

- `PyCFunctionFast`

- `PyCFunctionFastWithKeywords`

- `PyCFunctionWithKeywords`

- `PyCFunction_GetFlags()`

- `PyCFunction_GetFunction()`

- `PyCFunction_GetSelf()`

- `PyCFunction_New()`

- `PyCFunction_NewEx()`

- `PyCFunction_Type`

- `PyCMethod_New()`

- `PyCallIter_New()`

- `PyCallIter_Type`

- `PyCallable_Check()`

- `PyCapsule_Destructor`

- `PyCapsule_GetContext()`

- `PyCapsule_GetDestructor()`

- `PyCapsule_GetName()`

- `PyCapsule_GetPointer()`

- `PyCapsule_Import()`

- `PyCapsule_IsValid()`

- `PyCapsule_New()`

- `PyCapsule_SetContext()`

- `PyCapsule_SetDestructor()`

- `PyCapsule_SetName()`

- `PyCapsule_SetPointer()`

- `PyCapsule_Type`

- `PyClassMethodDescr_Type`

- `PyCodec_BackslashReplaceErrors()`

- `PyCodec_Decode()`

- `PyCodec_Decoder()`

- `PyCodec_Encode()`

- `PyCodec_Encoder()`

- `PyCodec_IgnoreErrors()`

- `PyCodec_IncrementalDecoder()`

- `PyCodec_IncrementalEncoder()`

- `PyCodec_KnownEncoding()`

- `PyCodec_LookupError()`

- `PyCodec_NameReplaceErrors()`

- `PyCodec_Register()`

- `PyCodec_RegisterError()`

- `PyCodec_ReplaceErrors()`

- `PyCodec_StreamReader()`

- `PyCodec_StreamWriter()`

- `PyCodec_StrictErrors()`

- `PyCodec_Unregister()`

- `PyCodec_XMLCharRefReplaceErrors()`

- `PyComplex_FromDoubles()`

- `PyComplex_ImagAsDouble()`

- `PyComplex_RealAsDouble()`

- `PyComplex_Type`

- `PyDescr_NewClassMethod()`

- `PyDescr_NewGetSet()`

- `PyDescr_NewMember()`

- `PyDescr_NewMethod()`

- `PyDictItems_Type`

- `PyDictIterItem_Type`

- `PyDictIterKey_Type`

- `PyDictIterValue_Type`

- `PyDictKeys_Type`

- `PyDictProxy_New()`

- `PyDictProxy_Type`

- `PyDictRevIterItem_Type`

- `PyDictRevIterKey_Type`

- `PyDictRevIterValue_Type`

- `PyDictValues_Type`

- `PyDict_Clear()`

- `PyDict_Contains()`

- `PyDict_Copy()`

- `PyDict_DelItem()`

- `PyDict_DelItemString()`

- `PyDict_GetItem()`

- `PyDict_GetItemRef()`

- `PyDict_GetItemString()`

- `PyDict_GetItemStringRef()`

- `PyDict_GetItemWithError()`

- `PyDict_Items()`

- `PyDict_Keys()`

- `PyDict_Merge()`

- `PyDict_MergeFromSeq2()`

- `PyDict_New()`

- `PyDict_Next()`

- `PyDict_SetItem()`

- `PyDict_SetItemString()`

- `PyDict_Size()`

- `PyDict_Type`

- `PyDict_Update()`

- `PyDict_Values()`

- `PyEllipsis_Type`

- `PyEnum_Type`

- `PyErr_BadArgument()`

- `PyErr_BadInternalCall()`

- `PyErr_CheckSignals()`

- `PyErr_Clear()`

- `PyErr_Display()`

- `PyErr_DisplayException()`

- `PyErr_ExceptionMatches()`

- `PyErr_Fetch()`

- `PyErr_Format()`

- `PyErr_FormatV()`

- `PyErr_GetExcInfo()`

- `PyErr_GetHandledException()`

- `PyErr_GetRaisedException()`

- `PyErr_GivenExceptionMatches()`

- `PyErr_NewException()`

- `PyErr_NewExceptionWithDoc()`

- `PyErr_NoMemory()`

- `PyErr_NormalizeException()`

- `PyErr_Occurred()`

- `PyErr_Print()`

- `PyErr_PrintEx()`

- `PyErr_ProgramText()`

- `PyErr_ResourceWarning()`

- `PyErr_Restore()`

- `PyErr_SetExcFromWindowsErr()`

- `PyErr_SetExcFromWindowsErrWithFilename()`

- `PyErr_SetExcFromWindowsErrWithFilenameObject()`

- `PyErr_SetExcFromWindowsErrWithFilenameObjects()`

- `PyErr_SetExcInfo()`

- `PyErr_SetFromErrno()`

- `PyErr_SetFromErrnoWithFilename()`

- `PyErr_SetFromErrnoWithFilenameObject()`

- `PyErr_SetFromErrnoWithFilenameObjects()`

- `PyErr_SetFromWindowsErr()`

- `PyErr_SetFromWindowsErrWithFilename()`

- `PyErr_SetHandledException()`

- `PyErr_SetImportError()`

- `PyErr_SetImportErrorSubclass()`

- `PyErr_SetInterrupt()`

- `PyErr_SetInterruptEx()`

- `PyErr_SetNone()`

- `PyErr_SetObject()`

- `PyErr_SetRaisedException()`

- `PyErr_SetString()`

- `PyErr_SyntaxLocation()`

- `PyErr_SyntaxLocationEx()`

- `PyErr_WarnEx()`

- `PyErr_WarnExplicit()`

- `PyErr_WarnFormat()`

- `PyErr_WriteUnraisable()`

- `PyEval_AcquireThread()`

- `PyEval_EvalCode()`

- `PyEval_EvalCodeEx()`

- `PyEval_EvalFrame()`

- `PyEval_EvalFrameEx()`

- `PyEval_GetBuiltins()`

- `PyEval_GetFrame()`

- `PyEval_GetFrameBuiltins()`

- `PyEval_GetFrameGlobals()`

- `PyEval_GetFrameLocals()`

- `PyEval_GetFuncDesc()`

- `PyEval_GetFuncName()`

- `PyEval_GetGlobals()`

- `PyEval_GetLocals()`

- `PyEval_InitThreads()`

- `PyEval_ReleaseThread()`

- `PyEval_RestoreThread()`

- `PyEval_SaveThread()`

- `PyExc_ArithmeticError`

- `PyExc_AssertionError`

- `PyExc_AttributeError`

- `PyExc_BaseException`

- `PyExc_BaseExceptionGroup`

- `PyExc_BlockingIOError`

- `PyExc_BrokenPipeError`

- `PyExc_BufferError`

- `PyExc_BytesWarning`

- `PyExc_ChildProcessError`

- `PyExc_ConnectionAbortedError`

- `PyExc_ConnectionError`

- `PyExc_ConnectionRefusedError`

- `PyExc_ConnectionResetError`

- `PyExc_DeprecationWarning`

- `PyExc_EOFError`

- `PyExc_EncodingWarning`

- `PyExc_EnvironmentError`

- `PyExc_Exception`

- `PyExc_FileExistsError`

- `PyExc_FileNotFoundError`

- `PyExc_FloatingPointError`

- `PyExc_FutureWarning`

- `PyExc_GeneratorExit`

- `PyExc_IOError`

- `PyExc_ImportError`

- `PyExc_ImportWarning`

- `PyExc_IndentationError`

- `PyExc_IndexError`

- `PyExc_InterruptedError`

- `PyExc_IsADirectoryError`

- `PyExc_KeyError`

- `PyExc_KeyboardInterrupt`

- `PyExc_LookupError`

- `PyExc_MemoryError`

- `PyExc_ModuleNotFoundError`

- `PyExc_NameError`

- `PyExc_NotADirectoryError`

- `PyExc_NotImplementedError`

- `PyExc_OSError`

- `PyExc_OverflowError`

- `PyExc_PendingDeprecationWarning`

- `PyExc_PermissionError`

- `PyExc_ProcessLookupError`

- `PyExc_RecursionError`

- `PyExc_ReferenceError`

- `PyExc_ResourceWarning`

- `PyExc_RuntimeError`

- `PyExc_RuntimeWarning`

- `PyExc_StopAsyncIteration`

- `PyExc_StopIteration`

- `PyExc_SyntaxError`

- `PyExc_SyntaxWarning`

- `PyExc_SystemError`

- `PyExc_SystemExit`

- `PyExc_TabError`

- `PyExc_TimeoutError`

- `PyExc_TypeError`

- `PyExc_UnboundLocalError`

- `PyExc_UnicodeDecodeError`

- `PyExc_UnicodeEncodeError`

- `PyExc_UnicodeError`

- `PyExc_UnicodeTranslateError`

- `PyExc_UnicodeWarning`

- `PyExc_UserWarning`

- `PyExc_ValueError`

- `PyExc_Warning`

- `PyExc_WindowsError`

- `PyExc_ZeroDivisionError`

- `PyExceptionClass_Name()`

- `PyException_GetArgs()`

- `PyException_GetCause()`

- `PyException_GetContext()`

- `PyException_GetTraceback()`

- `PyException_SetArgs()`

- `PyException_SetCause()`

- `PyException_SetContext()`

- `PyException_SetTraceback()`

- `PyFile_FromFd()`

- `PyFile_GetLine()`

- `PyFile_WriteObject()`

- `PyFile_WriteString()`

- `PyFilter_Type`

- `PyFloat_AsDouble()`

- `PyFloat_FromDouble()`

- `PyFloat_FromString()`

- `PyFloat_GetInfo()`

- `PyFloat_GetMax()`

- `PyFloat_GetMin()`

- `PyFloat_Type`

- `PyFrameObject`

- `PyFrame_GetCode()`

- `PyFrame_GetLineNumber()`

- `PyFrozenSet_New()`

- `PyFrozenSet_Type`

- `PyGC_Collect()`

- `PyGC_Disable()`

- `PyGC_Enable()`

- `PyGC_IsEnabled()`

- `PyGILState_Ensure()`

- `PyGILState_GetThisThreadState()`

- `PyGILState_Release()`

- `PyGILState_STATE`

- `PyGetSetDef`

- `PyGetSetDescr_Type`

- `PyImport_AddModule()`

- `PyImport_AddModuleObject()`

- `PyImport_AddModuleRef()`

- `PyImport_AppendInittab()`

- `PyImport_ExecCodeModule()`

- `PyImport_ExecCodeModuleEx()`

- `PyImport_ExecCodeModuleObject()`

- `PyImport_ExecCodeModuleWithPathnames()`

- `PyImport_GetImporter()`

- `PyImport_GetMagicNumber()`

- `PyImport_GetMagicTag()`

- `PyImport_GetModule()`

- `PyImport_GetModuleDict()`

- `PyImport_Import()`

- `PyImport_ImportFrozenModule()`

- `PyImport_ImportFrozenModuleObject()`

- `PyImport_ImportModule()`

- `PyImport_ImportModuleLevel()`

- `PyImport_ImportModuleLevelObject()`

- `PyImport_ReloadModule()`

- `PyIndex_Check()`

- `PyInterpreterState`

- `PyInterpreterState_Clear()`

- `PyInterpreterState_Delete()`

- `PyInterpreterState_Get()`

- `PyInterpreterState_GetDict()`

- `PyInterpreterState_GetID()`

- `PyInterpreterState_New()`

- `PyIter_Check()`

- `PyIter_Next()`

- `PyIter_NextItem()`

- `PyIter_Send()`

- `PyListIter_Type`

- `PyListRevIter_Type`

- `PyList_Append()`

- `PyList_AsTuple()`

- `PyList_GetItem()`

- `PyList_GetItemRef()`

- `PyList_GetSlice()`

- `PyList_Insert()`

- `PyList_New()`

- `PyList_Reverse()`

- `PyList_SetItem()`

- `PyList_SetSlice()`

- `PyList_Size()`

- `PyList_Sort()`

- `PyList_Type`

- `PyLongObject`

- `PyLongRangeIter_Type`

- `PyLong_AsDouble()`

- `PyLong_AsInt()`

- `PyLong_AsInt32()`

- `PyLong_AsInt64()`

- `PyLong_AsLong()`

- `PyLong_AsLongAndOverflow()`

- `PyLong_AsLongLong()`

- `PyLong_AsLongLongAndOverflow()`

- `PyLong_AsNativeBytes()`

- `PyLong_AsSize_t()`

- `PyLong_AsSsize_t()`

- `PyLong_AsUInt32()`

- `PyLong_AsUInt64()`

- `PyLong_AsUnsignedLong()`

- `PyLong_AsUnsignedLongLong()`

- `PyLong_AsUnsignedLongLongMask()`

- `PyLong_AsUnsignedLongMask()`

- `PyLong_AsVoidPtr()`

- `PyLong_FromDouble()`

- `PyLong_FromInt32()`

- `PyLong_FromInt64()`

- `PyLong_FromLong()`

- `PyLong_FromLongLong()`

- `PyLong_FromNativeBytes()`

- `PyLong_FromSize_t()`

- `PyLong_FromSsize_t()`

- `PyLong_FromString()`

- `PyLong_FromUInt32()`

- `PyLong_FromUInt64()`

- `PyLong_FromUnsignedLong()`

- `PyLong_FromUnsignedLongLong()`

- `PyLong_FromUnsignedNativeBytes()`

- `PyLong_FromVoidPtr()`

- `PyLong_GetInfo()`

- `PyLong_Type`

- `PyMap_Type`

- `PyMapping_Check()`

- `PyMapping_GetItemString()`

- `PyMapping_GetOptionalItem()`

- `PyMapping_GetOptionalItemString()`

- `PyMapping_HasKey()`

- `PyMapping_HasKeyString()`

- `PyMapping_HasKeyStringWithError()`

- `PyMapping_HasKeyWithError()`

- `PyMapping_Items()`

- `PyMapping_Keys()`

- `PyMapping_Length()`

- `PyMapping_SetItemString()`

- `PyMapping_Size()`

- `PyMapping_Values()`

- `PyMem_Calloc()`

- `PyMem_Free()`

- `PyMem_Malloc()`

- `PyMem_RawCalloc()`

- `PyMem_RawFree()`

- `PyMem_RawMalloc()`

- `PyMem_RawRealloc()`

- `PyMem_Realloc()`

- `PyMemberDef`

- `PyMemberDescr_Type`

- `PyMember_GetOne()`

- `PyMember_SetOne()`

- `PyMemoryView_FromBuffer()`

- `PyMemoryView_FromMemory()`

- `PyMemoryView_FromObject()`

- `PyMemoryView_GetContiguous()`

- `PyMemoryView_Type`

- `PyMethodDef`

- `PyMethodDescr_Type`

- `PyModuleDef`

- `PyModuleDef_Base`

- `PyModuleDef_Init()`

- `PyModuleDef_Type`

- `PyModule_Add()`

- `PyModule_AddFunctions()`

- `PyModule_AddIntConstant()`

- `PyModule_AddObject()`

- `PyModule_AddObjectRef()`

- `PyModule_AddStringConstant()`

- `PyModule_AddType()`

- `PyModule_Create2()`

- `PyModule_ExecDef()`

- `PyModule_FromDefAndSpec2()`

- `PyModule_GetDef()`

- `PyModule_GetDict()`

- `PyModule_GetFilename()`

- `PyModule_GetFilenameObject()`

- `PyModule_GetName()`

- `PyModule_GetNameObject()`

- `PyModule_GetState()`

- `PyModule_New()`

- `PyModule_NewObject()`

- `PyModule_SetDocString()`

- `PyModule_Type`

- `PyNumber_Absolute()`

- `PyNumber_Add()`

- `PyNumber_And()`

- `PyNumber_AsSsize_t()`

- `PyNumber_Check()`

- `PyNumber_Divmod()`

- `PyNumber_Float()`

- `PyNumber_FloorDivide()`

- `PyNumber_InPlaceAdd()`

- `PyNumber_InPlaceAnd()`

- `PyNumber_InPlaceFloorDivide()`

- `PyNumber_InPlaceLshift()`

- `PyNumber_InPlaceMatrixMultiply()`

- `PyNumber_InPlaceMultiply()`

- `PyNumber_InPlaceOr()`

- `PyNumber_InPlacePower()`

- `PyNumber_InPlaceRemainder()`

- `PyNumber_InPlaceRshift()`

- `PyNumber_InPlaceSubtract()`

- `PyNumber_InPlaceTrueDivide()`

- `PyNumber_InPlaceXor()`

- `PyNumber_Index()`

- `PyNumber_Invert()`

- `PyNumber_Long()`

- `PyNumber_Lshift()`

- `PyNumber_MatrixMultiply()`

- `PyNumber_Multiply()`

- `PyNumber_Negative()`

- `PyNumber_Or()`

- `PyNumber_Positive()`

- `PyNumber_Power()`

- `PyNumber_Remainder()`

- `PyNumber_Rshift()`

- `PyNumber_Subtract()`

- `PyNumber_ToBase()`

- `PyNumber_TrueDivide()`

- `PyNumber_Xor()`

- `PyOS_AfterFork()`

- `PyOS_AfterFork_Child()`

- `PyOS_AfterFork_Parent()`

- `PyOS_BeforeFork()`

- `PyOS_CheckStack()`

- `PyOS_FSPath()`

- `PyOS_InputHook`

- `PyOS_InterruptOccurred()`

- `PyOS_double_to_string()`

- `PyOS_getsig()`

- `PyOS_mystricmp()`

- `PyOS_mystrnicmp()`

- `PyOS_setsig()`

- `PyOS_sighandler_t`

- `PyOS_snprintf()`

- `PyOS_string_to_double()`

- `PyOS_strtol()`

- `PyOS_strtoul()`

- `PyOS_vsnprintf()`

- `PyObject`

- `PyObject.ob_refcnt`

- `PyObject.ob_type`

- `PyObject_ASCII()`

- `PyObject_AsFileDescriptor()`

- `PyObject_Bytes()`

- `PyObject_Call()`

- `PyObject_CallFunction()`

- `PyObject_CallFunctionObjArgs()`

- `PyObject_CallMethod()`

- `PyObject_CallMethodObjArgs()`

- `PyObject_CallNoArgs()`

- `PyObject_CallObject()`

- `PyObject_Calloc()`

- `PyObject_CheckBuffer()`

- `PyObject_ClearWeakRefs()`

- `PyObject_CopyData()`

- `PyObject_DelAttr()`

- `PyObject_DelAttrString()`

- `PyObject_DelItem()`

- `PyObject_DelItemString()`

- `PyObject_Dir()`

- `PyObject_Format()`

- `PyObject_Free()`

- `PyObject_GC_Del()`

- `PyObject_GC_IsFinalized()`

- `PyObject_GC_IsTracked()`

- `PyObject_GC_Track()`

- `PyObject_GC_UnTrack()`

- `PyObject_GenericGetAttr()`

- `PyObject_GenericGetDict()`

- `PyObject_GenericSetAttr()`

- `PyObject_GenericSetDict()`

- `PyObject_GetAIter()`

- `PyObject_GetAttr()`

- `PyObject_GetAttrString()`

- `PyObject_GetBuffer()`

- `PyObject_GetItem()`

- `PyObject_GetIter()`

- `PyObject_GetOptionalAttr()`

- `PyObject_GetOptionalAttrString()`

- `PyObject_GetTypeData()`

- `PyObject_HasAttr()`

- `PyObject_HasAttrString()`

- `PyObject_HasAttrStringWithError()`

- `PyObject_HasAttrWithError()`

- `PyObject_Hash()`

- `PyObject_HashNotImplemented()`

- `PyObject_Init()`

- `PyObject_InitVar()`

- `PyObject_IsInstance()`

- `PyObject_IsSubclass()`

- `PyObject_IsTrue()`

- `PyObject_Length()`

- `PyObject_Malloc()`

- `PyObject_Not()`

- `PyObject_Realloc()`

- `PyObject_Repr()`

- `PyObject_RichCompare()`

- `PyObject_RichCompareBool()`

- `PyObject_SelfIter()`

- `PyObject_SetAttr()`

- `PyObject_SetAttrString()`

- `PyObject_SetItem()`

- `PyObject_Size()`

- `PyObject_Str()`

- `PyObject_Type()`

- `PyObject_Vectorcall()`

- `PyObject_VectorcallMethod()`

- `PyProperty_Type`

- `PyRangeIter_Type`

- `PyRange_Type`

- `PyReversed_Type`

- `PySeqIter_New()`

- `PySeqIter_Type`

- `PySequence_Check()`

- `PySequence_Concat()`

- `PySequence_Contains()`

- `PySequence_Count()`

- `PySequence_DelItem()`

- `PySequence_DelSlice()`

- `PySequence_Fast()`

- `PySequence_GetItem()`

- `PySequence_GetSlice()`

- `PySequence_In()`

- `PySequence_InPlaceConcat()`

- `PySequence_InPlaceRepeat()`

- `PySequence_Index()`

- `PySequence_Length()`

- `PySequence_List()`

- `PySequence_Repeat()`

- `PySequence_SetItem()`

- `PySequence_SetSlice()`

- `PySequence_Size()`

- `PySequence_Tuple()`

- `PySetIter_Type`

- `PySet_Add()`

- `PySet_Clear()`

- `PySet_Contains()`

- `PySet_Discard()`

- `PySet_New()`

- `PySet_Pop()`

- `PySet_Size()`

- `PySet_Type`

- `PySlice_AdjustIndices()`

- `PySlice_GetIndices()`

- `PySlice_GetIndicesEx()`

- `PySlice_New()`

- `PySlice_Type`

- `PySlice_Unpack()`

- `PyState_AddModule()`

- `PyState_FindModule()`

- `PyState_RemoveModule()`

- `PyStructSequence_Desc`

- `PyStructSequence_Field`

- `PyStructSequence_GetItem()`

- `PyStructSequence_New()`

- `PyStructSequence_NewType()`

- `PyStructSequence_SetItem()`

- `PyStructSequence_UnnamedField`

- `PySuper_Type`

- `PySys_Audit()`

- `PySys_AuditTuple()`

- `PySys_FormatStderr()`

- `PySys_FormatStdout()`

- `PySys_GetAttr()`

- `PySys_GetAttrString()`

- `PySys_GetObject()`

- `PySys_GetOptionalAttr()`

- `PySys_GetOptionalAttrString()`

- `PySys_GetXOptions()`

- `PySys_SetArgv()`

- `PySys_SetArgvEx()`

- `PySys_SetObject()`

- `PySys_WriteStderr()`

- `PySys_WriteStdout()`

- `PyThreadState`

- `PyThreadState_Clear()`

- `PyThreadState_Delete()`

- `PyThreadState_Get()`

- `PyThreadState_GetDict()`

- `PyThreadState_GetFrame()`

- `PyThreadState_GetID()`

- `PyThreadState_GetInterpreter()`

- `PyThreadState_New()`

- `PyThreadState_SetAsyncExc()`

- `PyThreadState_Swap()`

- `PyThread_GetInfo()`

- `PyThread_ReInitTLS()`

- `PyThread_acquire_lock()`

- `PyThread_acquire_lock_timed()`

- `PyThread_allocate_lock()`

- `PyThread_create_key()`

- `PyThread_delete_key()`

- `PyThread_delete_key_value()`

- `PyThread_exit_thread()`

- `PyThread_free_lock()`

- `PyThread_get_key_value()`

- `PyThread_get_stacksize()`

- `PyThread_get_thread_ident()`

- `PyThread_get_thread_native_id()`

- `PyThread_init_thread()`

- `PyThread_release_lock()`

- `PyThread_set_key_value()`

- `PyThread_set_stacksize()`

- `PyThread_start_new_thread()`

- `PyThread_tss_alloc()`

- `PyThread_tss_create()`

- `PyThread_tss_delete()`

- `PyThread_tss_free()`

- `PyThread_tss_get()`

- `PyThread_tss_is_created()`

- `PyThread_tss_set()`

- `PyTraceBack_Here()`

- `PyTraceBack_Print()`

- `PyTraceBack_Type`

- `PyTupleIter_Type`

- `PyTuple_GetItem()`

- `PyTuple_GetSlice()`

- `PyTuple_New()`

- `PyTuple_Pack()`

- `PyTuple_SetItem()`

- `PyTuple_Size()`

- `PyTuple_Type`

- `PyTypeObject`

- `PyType_ClearCache()`

- `PyType_Freeze()`

- `PyType_FromMetaclass()`

- `PyType_FromModuleAndSpec()`

- `PyType_FromSpec()`

- `PyType_FromSpecWithBases()`

- `PyType_GenericAlloc()`

- `PyType_GenericNew()`

- `PyType_GetBaseByToken()`

- `PyType_GetFlags()`

- `PyType_GetFullyQualifiedName()`

- `PyType_GetModule()`

- `PyType_GetModuleByDef()`

- `PyType_GetModuleName()`

- `PyType_GetModuleState()`

- `PyType_GetName()`

- `PyType_GetQualName()`

- `PyType_GetSlot()`

- `PyType_GetTypeDataSize()`

- `PyType_IsSubtype()`

- `PyType_Modified()`

- `PyType_Ready()`

- `PyType_Slot`

- `PyType_Spec`

- `PyType_Type`

- `PyUnicodeDecodeError_Create()`

- `PyUnicodeDecodeError_GetEncoding()`

- `PyUnicodeDecodeError_GetEnd()`

- `PyUnicodeDecodeError_GetObject()`

- `PyUnicodeDecodeError_GetReason()`

- `PyUnicodeDecodeError_GetStart()`

- `PyUnicodeDecodeError_SetEnd()`

- `PyUnicodeDecodeError_SetReason()`

- `PyUnicodeDecodeError_SetStart()`

- `PyUnicodeEncodeError_GetEncoding()`

- `PyUnicodeEncodeError_GetEnd()`

- `PyUnicodeEncodeError_GetObject()`

- `PyUnicodeEncodeError_GetReason()`

- `PyUnicodeEncodeError_GetStart()`

- `PyUnicodeEncodeError_SetEnd()`

- `PyUnicodeEncodeError_SetReason()`

- `PyUnicodeEncodeError_SetStart()`

- `PyUnicodeIter_Type`

- `PyUnicodeTranslateError_GetEnd()`

- `PyUnicodeTranslateError_GetObject()`

- `PyUnicodeTranslateError_GetReason()`

- `PyUnicodeTranslateError_GetStart()`

- `PyUnicodeTranslateError_SetEnd()`

- `PyUnicodeTranslateError_SetReason()`

- `PyUnicodeTranslateError_SetStart()`

- `PyUnicode_Append()`

- `PyUnicode_AppendAndDel()`

- `PyUnicode_AsASCIIString()`

- `PyUnicode_AsCharmapString()`

- `PyUnicode_AsEncodedString()`

- `PyUnicode_AsLatin1String()`

- `PyUnicode_AsMBCSString()`

- `PyUnicode_AsRawUnicodeEscapeString()`

- `PyUnicode_AsUCS4()`

- `PyUnicode_AsUCS4Copy()`

- `PyUnicode_AsUTF16String()`

- `PyUnicode_AsUTF32String()`

- `PyUnicode_AsUTF8AndSize()`

- `PyUnicode_AsUTF8String()`

- `PyUnicode_AsUnicodeEscapeString()`

- `PyUnicode_AsWideChar()`

- `PyUnicode_AsWideCharString()`

- `PyUnicode_BuildEncodingMap()`

- `PyUnicode_Compare()`

- `PyUnicode_CompareWithASCIIString()`

- `PyUnicode_Concat()`

- `PyUnicode_Contains()`

- `PyUnicode_Count()`

- `PyUnicode_Decode()`

- `PyUnicode_DecodeASCII()`

- `PyUnicode_DecodeCharmap()`

- `PyUnicode_DecodeCodePageStateful()`

- `PyUnicode_DecodeFSDefault()`

- `PyUnicode_DecodeFSDefaultAndSize()`

- `PyUnicode_DecodeLatin1()`

- `PyUnicode_DecodeLocale()`

- `PyUnicode_DecodeLocaleAndSize()`

- `PyUnicode_DecodeMBCS()`

- `PyUnicode_DecodeMBCSStateful()`

- `PyUnicode_DecodeRawUnicodeEscape()`

- `PyUnicode_DecodeUTF16()`

- `PyUnicode_DecodeUTF16Stateful()`

- `PyUnicode_DecodeUTF32()`

- `PyUnicode_DecodeUTF32Stateful()`

- `PyUnicode_DecodeUTF7()`

- `PyUnicode_DecodeUTF7Stateful()`

- `PyUnicode_DecodeUTF8()`

- `PyUnicode_DecodeUTF8Stateful()`

- `PyUnicode_DecodeUnicodeEscape()`

- `PyUnicode_EncodeCodePage()`

- `PyUnicode_EncodeFSDefault()`

- `PyUnicode_EncodeLocale()`

- `PyUnicode_Equal()`

- `PyUnicode_EqualToUTF8()`

- `PyUnicode_EqualToUTF8AndSize()`

- `PyUnicode_FSConverter()`

- `PyUnicode_FSDecoder()`

- `PyUnicode_Find()`

- `PyUnicode_FindChar()`

- `PyUnicode_Format()`

- `PyUnicode_FromEncodedObject()`

- `PyUnicode_FromFormat()`

- `PyUnicode_FromFormatV()`

- `PyUnicode_FromObject()`

- `PyUnicode_FromOrdinal()`

- `PyUnicode_FromString()`

- `PyUnicode_FromStringAndSize()`

- `PyUnicode_FromWideChar()`

- `PyUnicode_GetDefaultEncoding()`

- `PyUnicode_GetLength()`

- `PyUnicode_InternFromString()`

- `PyUnicode_InternInPlace()`

- `PyUnicode_IsIdentifier()`

- `PyUnicode_Join()`

- `PyUnicode_Partition()`

- `PyUnicode_RPartition()`

- `PyUnicode_RSplit()`

- `PyUnicode_ReadChar()`

- `PyUnicode_Replace()`

- `PyUnicode_Resize()`

- `PyUnicode_RichCompare()`

- `PyUnicode_Split()`

- `PyUnicode_Splitlines()`

- `PyUnicode_Substring()`

- `PyUnicode_Tailmatch()`

- `PyUnicode_Translate()`

- `PyUnicode_Type`

- `PyUnicode_WriteChar()`

- `PyVarObject`

- `PyVarObject.ob_base`

- `PyVarObject.ob_size`

- `PyVectorcall_Call()`

- `PyVectorcall_NARGS()`

- `PyWeakReference`

- `PyWeakref_GetRef()`

- `PyWeakref_NewProxy()`

- `PyWeakref_NewRef()`

- `PyWrapperDescr_Type`

- `PyWrapper_New()`

- `PyZip_Type`

- `Py_AddPendingCall()`

- `Py_AtExit()`

- `Py_BEGIN_ALLOW_THREADS`

- `Py_BLOCK_THREADS`

- `Py_BuildValue()`

- `Py_BytesMain()`

- `Py_CompileString()`

- `Py_DecRef()`

- `Py_DecodeLocale()`

- `Py_END_ALLOW_THREADS`

- `Py_EncodeLocale()`

- `Py_EndInterpreter()`

- `Py_EnterRecursiveCall()`

- `Py_Exit()`

- `Py_FatalError()`

- `Py_FileSystemDefaultEncodeErrors`

- `Py_FileSystemDefaultEncoding`

- `Py_Finalize()`

- `Py_FinalizeEx()`

- `Py_GenericAlias()`

- `Py_GenericAliasType`

- `Py_GetBuildInfo()`

- `Py_GetCompiler()`

- `Py_GetConstant()`

- `Py_GetConstantBorrowed()`

- `Py_GetCopyright()`

- `Py_GetPlatform()`

- `Py_GetRecursionLimit()`

- `Py_GetVersion()`

- `Py_HasFileSystemDefaultEncoding`

- `Py_IncRef()`

- `Py_Initialize()`

- `Py_InitializeEx()`

- `Py_Is()`

- `Py_IsFalse()`

- `Py_IsFinalizing()`

- `Py_IsInitialized()`

- `Py_IsNone()`

- `Py_IsTrue()`

- `Py_LeaveRecursiveCall()`

- `Py_Main()`

- `Py_MakePendingCalls()`

- `Py_NewInterpreter()`

- `Py_NewRef()`

- `Py_PACK_FULL_VERSION()`

- `Py_PACK_VERSION()`

- `Py_REFCNT()`

- `Py_ReprEnter()`

- `Py_ReprLeave()`

- `Py_SetProgramName()`

- `Py_SetPythonHome()`

- `Py_SetRecursionLimit()`

- `Py_TYPE()`

- `Py_UCS4`

- `Py_UNBLOCK_THREADS`

- `Py_UTF8Mode`

- `Py_VaBuildValue()`

- `Py_Version`

- `Py_XNewRef()`

- `Py_buffer`

- `Py_intptr_t`

- `Py_ssize_t`

- `Py_uintptr_t`

- `allocfunc`

- `binaryfunc`

- `descrgetfunc`

- `descrsetfunc`

- `destructor`

- `getattrfunc`

- `getattrofunc`

- `getbufferproc`

- `getiterfunc`

- `getter`

- `hashfunc`

- `initproc`

- `inquiry`

- `iternextfunc`

- `lenfunc`

- `newfunc`

- `objobjargproc`

- `objobjproc`

- `releasebufferproc`

- `reprfunc`

- `richcmpfunc`

- `setattrfunc`

- `setattrofunc`

- `setter`

- `ssizeargfunc`

- `ssizeobjargproc`

- `ssizessizeargfunc`

- `ssizessizeobjargproc`

- `symtable`

- `ternaryfunc`

- `traverseproc`

- `unaryfunc`

- `vectorcallfunc`

- `visitproc`