pythoncapi_compat.h API¶
The pythoncapi_compat.h header file provides implementations of around 150
recent functions for old Python versions.
Supported Python versions:
Python 3.6 - 3.16
PyPy 3.6 - 3.12
The limited C API is only supported on CPython.
A C11 subset (without optional features) is required, like static inline
functions: see PEP 7.
C++03 and C++11 are supported on Python 3.6 and newer.
Private functions (name starting with _Py) are not supported.
Latest version of the header file: pythoncapi_compat.h.
Python 3.15¶
-
PyBytesWriter *PyBytesWriter_Create(Py_ssize_t size)¶
-
void *PyBytesWriter_GetData(PyBytesWriter *writer)¶
-
Py_ssize_t PyBytesWriter_GetSize(PyBytesWriter *writer)¶
-
PyObject *PyBytesWriter_FinishWithSize(PyBytesWriter *writer, Py_ssize_t size)¶
-
PyObject *PyBytesWriter_Finish(PyBytesWriter *writer)¶
-
PyObject *PyBytesWriter_FinishWithPointer(PyBytesWriter *writer, void *buf)¶
-
void PyBytesWriter_Discard(PyBytesWriter *writer)¶
-
int PyBytesWriter_Resize(PyBytesWriter *writer, Py_ssize_t size)¶
-
int PyBytesWriter_Grow(PyBytesWriter *writer, Py_ssize_t size)¶
-
void *PyBytesWriter_GrowAndUpdatePointer(PyBytesWriter *writer, Py_ssize_t size, void *buf)¶
-
int PyBytesWriter_WriteBytes(PyBytesWriter *writer, const void *bytes, Py_ssize_t size)¶
-
int PyBytesWriter_Format(PyBytesWriter *writer, const char *format, ...)¶
See PyBytesWriter documentation.
Not available on the limited C API.
-
PyObject *PySys_GetAttr(const char *name)¶
-
PyObject *PySys_GetAttrString(const char *name)¶
-
PyObject *PySys_GetOptionalAttr(const char *name)¶
-
PyObject *PySys_GetOptionalAttrString(const char *name)¶
-
PyObject *PyTuple_FromArray(PyObject *const *array, Py_ssize_t size)¶
-
Py_hash_t PyUnstable_Unicode_GET_CACHED_HASH(PyObject *op)¶
See PyUnstable_Unicode_GET_CACHED_HASH() documentation.
On PyPy, always returns
-1.Not available on the limited C API.
-
int PyUnstable_SetImmortal(PyObject *op)¶
See PyUnstable_SetImmortal() documentation.
Availability: Python 3.13 and newer.
Not available on PyPy, and not on the limited C API.
Not supported:
PyABIInfo_Check()PyAnyDict_Check()PyAnyDict_CheckExact()PyArg_ParseArray()PyArg_ParseArrayAndKeywords()PyFrozenDict_Check()PyFrozenDict_CheckExact()PyFrozenDict_New()PyImport_CreateModuleFromInitfunc()PyModule_FromSlotsAndSpec()PyModule_GetState_DuringGC()PyModule_GetToken_DuringGC()PyObject_CallFinalizerFromDealloc()PyObject_Dump()PyObject_GetItemData_DuringGC()PyObject_GetTypeData_DuringGC()PyType_FromSlots()PyType_GetBaseByToken_DuringGC()PyType_GetModuleByToken_DuringGC()PyType_GetModuleState_DuringGC()PyType_GetModule_DuringGC()PyUnstable_DumpTraceback()PyUnstable_DumpTracebackThreads()PyUnstable_ThreadState_ResetStackProtection()PyUnstable_ThreadState_SetStackProtection()
Python 3.14¶
-
struct PyLongLayout¶
See PyLongLayout documentation.
Not available on the limited C API.
-
const PyLongLayout *PyLong_GetNativeLayout(void)¶
See PyLong_GetNativeLayout() documentation.
Not available on the limited C API.
-
struct PyLongExport¶
See PyLongExport documentation.
Not available on the limited C API.
-
int PyLong_Export(PyObject *obj, PyLongExport *export_long)¶
See PyLong_Export() documentation.
Not available on the limited C API.
-
void PyLong_FreeExport(PyLongExport *export_long)¶
See PyLong_FreeExport() documentation.
Not available on the limited C API.
-
struct PyLongWriter¶
See PyLongWriter documentation.
Not available on the limited C API.
-
PyLongWriter *PyLongWriter_Create(int negative, Py_ssize_t ndigits, void **digits)¶
See PyLongWriter_Create() documentation.
Not available on the limited C API.
-
PyObject *PyLongWriter_Finish(PyLongWriter *writer)¶
See PyLongWriter_Finish() documentation.
Not available on the limited C API.
-
void PyLongWriter_Discard(PyLongWriter *writer)¶
See PyLongWriter_Discard() documentation.
Not available on the limited C API.
-
int PyLong_IsPositive(PyObject *obj)¶
-
int PyLong_IsNegative(PyObject *obj)¶
-
int PyLong_IsZero(PyObject *obj)¶
-
int PyLong_GetSign(PyObject *obj, int *sign)¶
-
PyObject *PyIter_NextItem(PyObject *sep, PyObject *iterable)¶
See PyIter_NextItem() documentation.
Not available on limited C API 3.9 and older.
-
PyObject *PyBytes_Join(PyObject *sep, PyObject *iterable)¶
-
Py_hash_t Py_HashBuffer(const void *ptr, Py_ssize_t len)¶
-
int PyUnicode_Equal(PyObject *str1, PyObject *str2)¶
-
PyUnicodeWriter *PyUnicodeWriter_Create(Py_ssize_t length)¶
See PyUnicodeWriter_Create() documentation.
Not available on the limited C API.
-
PyObject *PyUnicodeWriter_Finish(PyUnicodeWriter *writer)¶
See PyUnicodeWriter_Finish() documentation.
Not available on the limited C API.
-
void PyUnicodeWriter_Discard(PyUnicodeWriter *writer)¶
See PyUnicodeWriter_Discard() documentation.
Not available on the limited C API.
-
int PyUnicodeWriter_WriteChar(PyUnicodeWriter *writer, Py_UCS4 ch)¶
See PyUnicodeWriter_WriteChar() documentation.
Not available on the limited C API.
-
int PyUnicodeWriter_WriteUCS4(PyUnicodeWriter *writer, const Py_UCS4 *ucs4, Py_ssize_t size)¶
See PyUnicodeWriter_WriteUCS4() documentation.
Not available on the limited C API.
-
int PyUnicodeWriter_WriteUTF8(PyUnicodeWriter *writer, const char *str, Py_ssize_t size)¶
See PyUnicodeWriter_WriteUTF8() documentation.
Not available on the limited C API.
-
int PyUnicodeWriter_WriteASCII(PyUnicodeWriter *writer, const char *str, Py_ssize_t size)¶
See PyUnicodeWriter_WriteASCII() documentation.
Not available on the limited C API.
-
int PyUnicodeWriter_WriteWideChar(PyUnicodeWriter *writer, const wchar_t *str, Py_ssize_t size)¶
See PyUnicodeWriter_WriteWideChar() documentation.
Not available on the limited C API.
-
int PyUnicodeWriter_WriteStr(PyUnicodeWriter *writer, PyObject *obj)¶
See PyUnicodeWriter_WriteStr() documentation.
Not available on the limited C API.
-
int PyUnicodeWriter_WriteRepr(PyUnicodeWriter *writer, PyObject *obj)¶
See PyUnicodeWriter_WriteRepr() documentation.
Not available on the limited C API.
-
int PyUnicodeWriter_WriteSubstring(PyUnicodeWriter *writer, PyObject *str, Py_ssize_t start, Py_ssize_t end)¶
See PyUnicodeWriter_WriteSubstring() documentation.
Not available on the limited C API.
-
int PyUnicodeWriter_Format(PyUnicodeWriter *writer, const char *format, ...)¶
See PyUnicodeWriter_Format() documentation.
Not available on the limited C API.
-
int PyLong_AsInt32(PyObject *obj, int32_t *pvalue)¶
-
int PyLong_AsInt64(PyObject *obj, int64_t *pvalue)¶
-
int PyLong_AsUInt32(PyObject *obj, uint32_t *pvalue)¶
-
int PyLong_AsUInt64(PyObject *obj, uint64_t *pvalue)¶
-
PyObject *PyLong_FromInt32(int32_t value)¶
-
PyObject *PyLong_FromInt64(int64_t value)¶
-
PyObject *PyLong_FromUInt32(uint32_t value)¶
-
PyObject *PyLong_FromUInt64(uint64_t value)¶
-
FILE *Py_fopen(PyObject *path, const char *mode)¶
-
int Py_fclose(FILE *file)¶
-
PyObject *PyConfig_Get(const char *name)¶
See PyConfig_Get() documentation.
Availability: Python 3.9 and newer.
Not available on PyPy and not on the limited C API.
-
int PyConfig_GetInt(const char *name, int *value)¶
See PyConfig_GetInt() documentation.
Availability: Python 3.9 and newer.
Not available on PyPy and not on the limited C API.
-
int PyUnstable_Object_IsUniquelyReferenced(PyObject *op)¶
See PyUnstable_Object_IsUniquelyReferenced() documentation.
Not available on PyPy.
Py_REFCNT()semantics is different on PyPy.Not available on the limited C API.
-
int PyUnstable_TryIncRef(PyObject *op)¶
See PyUnstable_TryIncRef() documentation.
Not available on PyPy.
Py_REFCNT()semantics is different on PyPy.
-
void PyUnstable_EnableTryIncRef(PyObject *op)¶
See PyUnstable_EnableTryIncRef() documentation.
Not available on PyPy.
Py_REFCNT()semantics is different on PyPy.
-
PyObject *PyImport_ImportModuleAttr(PyObject *mod_name, PyObject *attr_name)¶
-
PyObject *PyImport_ImportModuleAttrString(const char *mod_name, const char *attr_name)¶
-
uint32_t Py_PACK_FULL_VERSION(int major, int minor, int micro, int release_level, int release_serial)¶
-
uint32_t Py_PACK_VERSION(int major, int minor)¶
Not supported:
PyConfig_Names()PyConfig_Set()PyInitConfig_AddModule()PyInitConfig_Create()PyInitConfig_Free()PyInitConfig_FreeStrList()PyInitConfig_GetError()PyInitConfig_GetExitCode()PyInitConfig_GetInt()PyInitConfig_GetStr()PyInitConfig_GetStrList()PyInitConfig_HasOption()PyInitConfig_SetInt()PyInitConfig_SetStr()PyInitConfig_SetStrList()PyMonitoring_FireBranchLeftEvent()PyMonitoring_FireBranchRightEvent()PyType_Freeze()PyType_GetBaseByToken()PyUnicodeWriter_DecodeUTF8Stateful()PyUnstable_IsImmortal()PyUnstable_Object_EnableDeferredRefcount()PyUnstable_Object_IsUniqueReferencedTemporary()Py_InitializeFromInitConfig()
Python 3.13¶
-
PyObject *Py_GetConstant(unsigned int constant_id)¶
-
int PyDict_GetItemRef(PyObject *p, PyObject *key, PyObject **result)¶
-
int PyDict_GetItemStringRef(PyObject *p, const char *key, PyObject **result)¶
-
PyObject *PyImport_AddModuleRef(const char *name)¶
-
int PyObject_GetOptionalAttr(PyObject *obj, PyObject *attr_name, PyObject **result)¶
-
int PyObject_GetOptionalAttrString(PyObject *obj, const char *attr_name, PyObject **result)¶
-
int PyObject_HasAttrWithError(PyObject *obj, PyObject *attr_name)¶
-
int PyObject_HasAttrStringWithError(PyObject *obj, const char *attr_name)¶
-
int PyMapping_GetOptionalItem(PyObject *obj, PyObject *key, PyObject **result)¶
-
int PyMapping_GetOptionalItemString(PyObject *obj, const char *key, PyObject **result)¶
-
int PyMapping_HasKeyWithError(PyObject *obj, PyObject *key)¶
-
int PyMapping_HasKeyStringWithError(PyObject *obj, const char *key)¶
-
int PyModule_Add(PyObject *module, const char *name, PyObject *value)¶
-
int PyWeakref_GetRef(PyObject *ref, PyObject **pobj)¶
-
int Py_IsFinalizing()¶
Return non-zero if the Python interpreter is shutting down, return 0 otherwise.
Availability: Python 3.3 and newer, PyPy 7.3 and newer, limited C API 3.13.
-
int PyDict_ContainsString(PyObject *p, const char *key)¶
-
int PyLong_AsInt(PyObject *obj)¶
-
int PyObject_VisitManagedDict(PyObject *obj, visitproc visit, void *arg)¶
See PyObject_VisitManagedDict() documentation.
Availability: Python 3.11 and newer.
Not available on the limited C API.
-
void PyObject_ClearManagedDict(PyObject *obj)¶
See PyObject_ClearManagedDict() documentation.
Availability: Python 3.11 and newer.
Not available on the limited C API.
-
PyThreadState *PyThreadState_GetUnchecked(void)¶
See PyThreadState_GetUnchecked() documentation.
Available on Python 3.5.2 and newer. Not available on the limited C API.
-
int PyUnicode_EqualToUTF8(PyObject *unicode, const char *str)¶
-
int PyUnicode_EqualToUTF8AndSize(PyObject *unicode, const char *str, Py_ssize_t size)¶
-
int PyList_Extend(PyObject *list, PyObject *iterable)¶
-
int PyList_Clear(PyObject *list)¶
-
int PyDict_Pop(PyObject *dict, PyObject *key, PyObject **result)¶
-
int PyDict_PopString(PyObject *dict, const char *key, PyObject **result)¶
-
Py_hash_t Py_HashPointer(const void *ptr)¶
-
Py_hash_t PyObject_GenericHash(PyObject *obj)¶
-
type PyTime_t¶
A timestamp or duration in nanoseconds, represented as a signed 64-bit integer.
Not available on the limited C API.
-
double PyTime_AsSecondsDouble(PyTime_t t)¶
See PyTime_AsSecondsDouble() documentation.
Not available on the limited C API.
-
int PyTime_Monotonic(PyTime_t *result)¶
See PyTime_Monotonic() documentation.
Not available on the limited C API.
-
int PyTime_Time(PyTime_t *result)¶
See PyTime_Time() documentation.
Not available on the limited C API.
-
int PyTime_PerfCounter(PyTime_t *result)¶
See PyTime_PerfCounter() documentation.
Not available on the limited C API.
-
PyObject *PyList_GetItemRef(PyObject *op, Py_ssize_t index)¶
-
int PyDict_SetDefaultRef(PyObject *d, PyObject *key, PyObject *default_value, PyObject **result)¶
-
PyObject *PyType_GetModuleName(PyTypeObject *type)¶
-
PyObject *PyType_GetFullyQualifiedName(PyTypeObject *type)¶
-
PyObject *PyEval_GetFrameLocals(void)¶
-
PyObject *PyEval_GetFrameGlobals(void)¶
-
PyObject *PyEval_GetFrameBuiltins(void)¶
-
Py_BEGIN_CRITICAL_SECTION(op)¶
-
Py_END_CRITICAL_SECTION()¶
-
Py_BEGIN_CRITICAL_SECTION2(a, b)¶
-
Py_END_CRITICAL_SECTION2()¶
Not supported:
PyErr_FormatUnraisable().PyLong_AsNativeBytes()PyLong_FromNativeBytes()PyLong_FromUnsignedNativeBytes()PyMonitoring_EnterScope()PyMonitoring_ExitScope()PyMonitoring_FireCRaiseEvent()PyMonitoring_FireCReturnEvent()PyMonitoring_FireCallEvent()PyMonitoring_FireExceptionHandledEvent()PyMonitoring_FireJumpEvent()PyMonitoring_FireLineEvent()PyMonitoring_FirePyResumeEvent()PyMonitoring_FirePyReturnEvent()PyMonitoring_FirePyStartEvent()PyMonitoring_FirePyThrowEvent()PyMonitoring_FirePyUnwindEvent()PyMonitoring_FirePyYieldEvent()PyMonitoring_FireRaiseEvent()PyMonitoring_FireReraiseEvent()PyMonitoring_FireStopIterationEvent()PyMutex_Lock()PyMutex_Unlock()PyRefTracer_GetTracer()PyRefTracer_SetTracer()PySys_Audit()PySys_AuditTuple()PyTime_MonotonicRaw()PyTime_PerfCounterRaw()PyTime_TimeRaw()
Python 3.12¶
-
PyObject *PyFrame_GetVar(PyFrameObject *frame, PyObject *name)¶
See PyFrame_GetVar() documentation.
Not available on PyPy nor with the limited C API.
-
PyObject *PyFrame_GetVarString(PyFrameObject *frame, const char *name)¶
See PyFrame_GetVarString() documentation.
Not available on PyPy nor with the limited C API.
-
PyObject *Py_GetConstantBorrowed(unsigned int constant_id)¶
Not supported:
PyCode_AddWatcher()PyCode_ClearWatcher()PyDict_AddWatcher()PyDict_Watch()PyErr_DisplayException()PyErr_GetRaisedException()PyErr_SetRaisedException()PyEval_SetProfileAllThreads()PyEval_SetTraceAllThreads()PyException_GetArgs()PyException_SetArgs()PyFunction_SetVectorcall()PyObject_GetTypeData()PyType_AddWatcher()PyType_FromMetaclass()(implementation too big to be backported)PyType_Watch()PyUnstable_Code_GetExtra()PyUnstable_Code_New()PyUnstable_Code_NewWithPosOnlyArgs()PyUnstable_Code_SetExtra()PyUnstable_Eval_RequestCodeExtraIndex()PyVectorcall_Call()Py_NewInterpreterFromConfig()
Python 3.11¶
-
PyObject *PyCode_GetCellvars(PyCodeObject *code)¶
See PyCode_GetCellvars() documentation.
Not available on PyPy nor on limited C API 3.10 and older.
-
PyObject *PyCode_GetCode(PyCodeObject *code)¶
See PyCode_GetCode() documentation.
Not available on PyPy nor on limited C API 3.10 and older.
-
PyObject *PyCode_GetFreevars(PyCodeObject *code)¶
See PyCode_GetFreevars() documentation.
Not available on PyPy nor on limited C API 3.10 and older.
-
PyObject *PyCode_GetVarnames(PyCodeObject *code)¶
See PyCode_GetVarnames() documentation.
Not available on PyPy nor on limited C API 3.10 and older.
-
PyObject *PyFrame_GetBuiltins(PyFrameObject *frame)¶
See PyFrame_GetBuiltins() documentation.
Not available on PyPy nor on limited C API 3.10 and older.
-
PyObject *PyFrame_GetGlobals(PyFrameObject *frame)¶
See PyFrame_GetGlobals() documentation.
Not available on PyPy.
-
int PyFrame_GetLasti(PyFrameObject *frame)¶
See PyFrame_GetLasti() documentation.
Not available on PyPy nor on limited C API 3.10 and older.
-
PyObject *PyFrame_GetLocals(PyFrameObject *frame)¶
See PyFrame_GetLocals() documentation.
Not available on PyPy nor on limited C API 3.10 and older.
-
void PyThreadState_EnterTracing(PyThreadState *tstate)¶
See PyThreadState_EnterTracing() documentation.
Not available on PyPy nor on limited C API 3.10 and older.
-
void PyThreadState_LeaveTracing(PyThreadState *tstate)¶
See PyThreadState_LeaveTracing() documentation.
Not available on PyPy nor on limited C API 3.10 and older.
-
int PyFloat_Pack2(double x, unsigned char *p, int le)¶
Pack a C double as the IEEE 754 binary16 half-precision format.
Availability: Python 3.6 and newer.
Not available on PyPy nor on limited C API.
-
int PyFloat_Pack4(double x, unsigned char *p, int le)¶
Pack a C double as the IEEE 754 binary32 single precision format.
Not available on PyPy nor on limited C API.
-
int PyFloat_Pack8(double x, unsigned char *p, int le)¶
Pack a C double as the IEEE 754 binary64 double precision format.
Not available on PyPy nor on limited C API.
-
double PyFloat_Unpack2(const unsigned char *p, int le)¶
Unpack the IEEE 754 binary16 half-precision format as a C double.
Availability: Python 3.6 and newer.
Not available on PyPy nor on limited C API.
-
double PyFloat_Unpack4(const unsigned char *p, int le)¶
Unpack the IEEE 754 binary32 single precision format as a C double.
Not available on PyPy nor on limited C API.
-
double PyFloat_Unpack8(const unsigned char *p, int le)¶
Unpack the IEEE 754 binary64 double precision format as a C double.
Not available on PyPy nor on limited C API.
-
PyObject *PyType_GetName(PyTypeObject *type)¶
-
PyObject *PyType_GetQualName(PyTypeObject *type)¶
Not supported:
PyErr_GetHandledException()PyErr_SetHandledException()PyFrame_GetGenerator()PyType_GetModuleByDef()Py_Versionconstant
Python 3.10¶
-
PyObject *Py_NewRef(PyObject *obj)¶
-
PyObject *Py_XNewRef(PyObject *obj)¶
-
int Py_Is(PyObject *x, PyObject *y)¶
-
int Py_IsNone(PyObject *x)¶
-
int Py_IsTrue(PyObject *x)¶
-
int Py_IsFalse(PyObject *x)¶
-
int PyModule_AddObjectRef(PyObject *module, const char *name, PyObject *value)¶
Not supported:
PyCodec_Unregister()PyDateTime_DATE_GET_TZINFO()PyDateTime_TIME_GET_TZINFO()PyErr_SetInterruptEx()PyGC_Disable()PyGC_Enable()PyGC_IsEnabled()PyIter_Send()PySet_CheckExact()Py_TPFLAGS_DISALLOW_INSTANTIATIONconstantPy_TPFLAGS_IMMUTABLETYPEconstant
Python 3.9¶
PyObject¶
-
void Py_SET_REFCNT(PyObject *ob, Py_ssize_t refcnt)¶
-
void Py_SET_TYPE(PyObject *ob, PyTypeObject *type)¶
-
void Py_SET_SIZE(PyVarObject *ob, Py_ssize_t size)¶
-
int Py_IS_TYPE(const PyObject *ob, const PyTypeObject *type)¶
-
PyObject *PyObject_CallNoArgs(PyObject *func)¶
-
PyObject *PyObject_CallOneArg(PyObject *func, PyObject *arg)¶
-
PyObject *PyObject_Vectorcall(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames)¶
-
Py_ssize_t PyVectorcall_NARGS(size_t nargsf)¶
-
PY_VECTORCALL_ARGUMENTS_OFFSET¶
PyFrameObject¶
-
PyCodeObject *PyFrame_GetCode(PyFrameObject *frame)¶
See PyFrame_GetCode() documentation.
Not available on limited C API 3.8 and older.
-
PyFrameObject *PyFrame_GetBack(PyFrameObject *frame)¶
See PyFrame_GetBack() documentation.
Not available on PyPy nor with the limited C API.
PyThreadState¶
-
PyFrameObject *PyThreadState_GetFrame(PyThreadState *tstate)¶
See PyThreadState_GetFrame() documentation.
Availability: PyPy 3.11 and newer, and limited C API 3.9.
-
PyInterpreterState *PyThreadState_GetInterpreter(PyThreadState *tstate)¶
See PyThreadState_GetInterpreter() documentation.
Not available on limited C API 3.8 and older.
-
uint64_t PyThreadState_GetID(PyThreadState *tstate)¶
See PyThreadState_GetID() documentation.
Availability: Python 3.7.
Not available on PyPy nor on limited C API 3.8 and older.
PyInterpreterState¶
-
PyInterpreterState *PyInterpreterState_Get(void)¶
See PyInterpreterState_Get() documentation.
Not available on limited C API 3.8 and older on Unix.
Not available in stable ABI 3.9 and older on Windows.
GC protocol¶
-
int PyObject_GC_IsTracked(PyObject *obj)¶
See PyObject_GC_IsTracked() documentation.
Not available on PyPy nor on limited C API 3.9 and older.
-
int PyObject_GC_IsFinalized(PyObject *obj)¶
See PyObject_GC_IsFinalized() documentation.
Availability: Python 3.4. Not available on PyPy nor on limited C API 3.9 and older.
Module helper¶
-
int PyModule_AddType(PyObject *module, PyTypeObject *type)¶
Not supported¶
PyObject_VectorcallMethod()PyType_FromModuleAndSpec()PyType_GetModule()PyType_GetModuleState()PyVectorcall_CallMethod()
Python 3.8¶
Not supported:
PyCode_NewWithPosOnlyArgs().
Python 3.7¶
Not supported:
PyContextToken_CheckExact()PyContextToken_CheckExact()PyContextVar_CheckExact()PyContextVar_Get()PyContextVar_New()PyContextVar_Reset()PyContextVar_Set()PyContext_AddWatcher()PyContext_CheckExact()PyContext_ClearWatcher()PyContext_Copy()PyContext_CopyCurrent()PyContext_Enter()PyContext_Exit()PyContext_New()PyImport_GetModule()PyInterpreterState_GetID()PyOS_AfterFork_Child()PyOS_AfterFork_Parent()PyOS_BeforeFork()PySlice_AdjustIndices()PySlice_Unpack()PyThread_tss_alloc()PyThread_tss_create()PyThread_tss_delete()PyThread_tss_free()PyThread_tss_get()PyThread_tss_is_created()PyThread_tss_set()PyTimeZone_FromOffset()PyTimeZone_FromOffsetAndName()PyTraceMalloc_Track()PyTraceMalloc_Untrack()Py_RETURN_RICHCOMPARE()Py_UNREACHABLEmacro
Python 3.6¶
Not supported:
PyErr_ResourceWarning().PyErr_SetImportErrorSubclass().PyOS_FSPath().Py_FinalizeEx().
Python 3.5¶
-
Py_SETREF(op, op2)¶
-
Py_XSETREF(op, op2)¶
Not supported:
PyCodec_NameReplaceErrors()PyErr_FormatV()PyExc_RecursionErrorPyMem_Calloc()PyMem_RawCalloc()PyModule_ExecDef()PyModule_FromDefAndSpec()PyModule_FromDefAndSpec2()PyNumber_InPlaceMatrixMultiply()PyNumber_MatrixMultiply()PyObject_Calloc()Py_DecodeLocale()Py_EncodeLocale()
Python 3.4¶
-
Py_UNUSED(name)¶
Not supported:
PyObject_LengthHint()PyStructSequence_InitType2()PyType_GetSlot()Py_SetStandardStreamEncoding()
Python 3.3¶
Not supported:
PyMemoryView_FromMemory()PyUnicode_AsUCS4()PyUnicode_AsUCS4Copy()PyUnicode_CopyCharacters()PyUnicode_FindChar()PyUnicode_FromKindAndData()PyUnicode_GET_LENGTH()PyUnicode_GetLength()PyUnicode_New()PyUnicode_ReadChar()PyUnicode_Substring()PyUnicode_WriteChar()
Python 3.2¶
Not supported:
Py_VA_COPY.PySys_SetArgvEx().PyLong_AsLongLongAndOverflow().PyErr_NewExceptionWithDoc().
Python 3.1¶
Not supported:
PyCapsule_CheckExact()PyCapsule_GetContext()PyCapsule_GetDestructor()PyCapsule_GetName()PyCapsule_GetPointer()PyCapsule_Import()PyCapsule_IsValid()PyCapsule_New()PyCapsule_SetContext()PyCapsule_SetDestructor()PyCapsule_SetName()PyCapsule_SetPointer()PyOS_string_to_double()
Python 3.0¶
There are too many changes compared to Python 2.7, but it’s no longer useful to document them.