The deadparrot project is a C API compatibility shared library: provide new functions to old Python versions and old functions to new Python versions.
Support Python 2.7, Python 3.6-3.13, PyPy 2.7 and PyPy 3.6-3.10.
This project is distributed under the Zero Clause BSD (0BSD) license and is covered by the PSF Code of Conduct.
See also the pythoncapi-compat project: header file providing new functions to old Python versions.
Functions provided by the deadparrot library.
PyMapping_GetOptionalItem()
PyMapping_GetOptionalItemString()
PyMapping_HasKeyStringWithError()
PyMapping_HasKeyWithError()
PyObject_GetOptionalAttr()
PyObject_GetOptionalAttrString()
PyObject_HasAttrStringWithError()
PyObject_HasAttrWithError()
PyCFunction_Call()
PyEval_CallFunction()
PyEval_CallMethod()
PyEval_CallObject()
PyEval_CallObjectWithKeywords()
PyObject_CallNoArgs()
PyObject_CallOneArg()
PyObject_Vectorcall()
PyVectorcall_NARGS()
_PyObject_FastCall()
: Python >= 3.6
PyCode_GetCellvars()
PyCode_GetCode()
PyCode_GetFreevars()
PyCode_GetVarnames()
PyDict_ContainsString()
PyDict_GetItemRef()
PyDict_GetItemStringRef()
PyDict_Pop()
PyDict_PopString()
PyDict_SetDefaultRef()
PyFPE_END_PROTECT()
PyFPE_START_PROTECT()
PyFloat_Pack2()
PyFloat_Pack4()
PyFloat_Pack8()
PyFloat_Unpack2()
PyFloat_Unpack4()
PyFloat_Unpack8()
PyFrame_GetBack()
PyFrame_GetBuiltins()
PyFrame_GetCode()
PyFrame_GetGlobals()
PyFrame_GetLasti()
PyFrame_GetLocals()
PyFrame_GetVar()
PyFrame_GetVarString()
PyObject_GC_IsFinalized()
PyObject_GC_IsTracked()
PyList_Clear()
PyList_Extend()
PyList_GetItemRef()
PyLong_AsInt()
PyHASH_BITS
constantPyHASH_IMAG
constantPyHASH_INF
constantPyHASH_MODULUS
constantPy_HashPointer()
PyInterpreterState_Get()
_PyInterpreterState_Get()
Py_IsFinalizing()
PyImport_AddModuleRef()
PyModule_AddObjectRef()
PyModule_AddType()
PyModule_Add()
PyObject_ClearManagedDict()
PyObject_VisitManagedDict()
Py_GetConstant()
Py_GetConstantBorrowed()
Py_IS_TYPE()
Py_Is()
Py_IsFalse()
Py_IsNone()
Py_IsTrue()
Py_NewRef()
Py_SET_REFCNT()
Py_SET_SIZE()
Py_SET_TYPE()
Py_XNewRef()
PyThreadState_EnterTracing()
PyThreadState_GetFrame()
PyThreadState_GetID()
PyThreadState_GetInterpreter()
PyThreadState_GetUnchecked()
PyThreadState_LeaveTracing()
PyTime_AsSecondsDouble()
PyTime_Monotonic()
PyTime_PerfCounter()
PyTime_Time()
PyUnicode_EqualToUTF8()
PyUnicode_EqualToUTF8AndSize()
PyUnicode_GetMax()
PyUnicode_InternImmortal()
: Python >= 3.0
PyWeakref_GetRef()
PyEval_InitThreads()
Run tests on all available Python versions:
python3 runtests.py
Build dependencies:
- cmake 3.5 or newer is required to build libparrot
- setuptools is needed by tests
Build command:
cd src cmake -B build/ -D CMAKE_BUILD_TYPE=Release cmake --build build --config Release
Change the destination to install to a specific directory:
cmake -B build/ -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/custom/prefix
PyEval_AcquireLock()
PyEval_ReleaseLock()
PyEval_ThreadsInitialized()
PyObject_AsCharBuffer()
PyObject_AsReadBuffer()
PyObject_AsWriteBuffer()
PyObject_CheckReadBuffer()
PySys_AddWarnOption()
PySys_AddWarnOptionUnicode()
PySys_AddXOption()
PySys_HasWarnOptions()
PySys_SetArgv()
PySys_SetArgvEx()
PySys_SetPath()
Py_SetPath()
Py_SetProgramName()
Py_SetPythonHome()
Py_SetStandardStreamEncoding()
Py_TRASHCAN_SAFE_BEGIN
Py_TRASHCAN_SAFE_END
_Py_SetProgramFullPath()
PyUnicode_AS_DATA()
PyUnicode_AS_UNICODE()
PyUnicode_AsUnicode()
PyUnicode_AsUnicodeAndSize()
PyUnicode_FromUnicode()
PyUnicode_GET_DATA_SIZE()
PyUnicode_GET_SIZE()
PyUnicode_GetSize()
PyUnicode_WCHAR_KIND()
HAVE_PY_SET_53BIT_PRECISION
PyFrame_BlockPop()
PyFrame_BlockSetup()
PyHeapType_GET_MEMBERS()
PyUnicode_Encode()
PyUnicode_EncodeASCII()
PyUnicode_EncodeCharmap()
PyUnicode_EncodeDecimal()
PyUnicode_EncodeLatin1()
PyUnicode_EncodeRawUnicodeEscape()
PyUnicode_EncodeUTF16()
PyUnicode_EncodeUTF32()
PyUnicode_EncodeUTF7()
PyUnicode_EncodeUTF8()
PyUnicode_EncodeUnicodeEscape()
PyUnicode_TransformDecimalToASCII()
PyUnicode_TranslateCharmap()
Py_ADJUST_ERANGE1()
Py_ADJUST_ERANGE2()
Py_FORCE_DOUBLE()
Py_OVERFLOWED()
Py_SET_ERANGE_IF_OVERFLOW()
Py_SET_ERRNO_ON_MATH_ERROR()
Py_UNICODE_COPY()
Py_UNICODE_FILL()
PyAST_Compile()
PyAST_CompileEx()
PyAST_CompileObject()
PyAST_Validate()
PyArena_AddPyObject()
PyArena_Free()
PyArena_Malloc()
PyArena_New()
PyFuture_FromAST()
PyFuture_FromASTObject()
PyLong_FromUnicode()
PyOS_InitInterrupts()
PyParser_ASTFromFile()
PyParser_ASTFromFileObject()
PyParser_ASTFromFilename()
PyParser_ASTFromString()
PyParser_ASTFromStringObject()
PyST_GetScope()
PySymtable_Build()
PySymtable_BuildObject()
PySymtable_Free()
PyUnicode_AsUnicodeCopy()
Py_ALLOW_RECURSION
Py_END_ALLOW_RECURSION
Py_SymtableString()
Py_SymtableStringObject()
Py_UNICODE_strcat()
Py_UNICODE_strchr()
Py_UNICODE_strcmp()
Py_UNICODE_strcpy()
Py_UNICODE_strlen()
Py_UNICODE_strncmp()
Py_UNICODE_strncpy()
Py_UNICODE_strrchr()
PyAsyncGen_ClearFreeLists()
PyCFunction_ClearFreeList()
PyCmpWrapper_Type()
PyContext_ClearFreeList()
PyDict_ClearFreeList()
PyFloat_ClearFreeList()
PyFrame_ClearFreeList()
PyFrame_ExtendStack()
PyList_ClearFreeList()
PyMethod_ClearFreeList()
PyNoArgsFunction()
PyNullImporter_Type()
PySet_ClearFreeList()
PySortWrapper_Type()
PyTuple_ClearFreeList()
PyUnicode_ClearFreeList()
Py_UNICODE_MATCH()
_PyAIterWrapper_Type()
_PyBytes_InsertThousandsGrouping()
_PyBytes_InsertThousandsGroupingLocale()
_PyFloat_Digits()
: implementation was removed in Python 2.6_PyFloat_DigitsInit()
: implementation was removed in Python 2.6_PyFloat_Repr()
: implementation was removed in Python 3.1_PyThreadState_GetFrame()
_PyUnicode_ClearStaticStrings()
_Py_InitializeFromArgs()
_Py_InitializeFromWideArgs()
PyByteArray_Init()
PyByteArray_Fini()
PyCObject_AsVoidPtr()
PyCObject_Check()
PyCObject_FromVoidPtr()
PyCObject_FromVoidPtrAndDesc()
PyCObject_GetDesc()
PyCObject_Import()
PyCObject_SetVoidPtr()
PyOS_ascii_atof()
PyOS_ascii_formatd()
PyOS_ascii_strtod()
PyNumber_Int()
PyString
prefix replaced withPyUnicode
PyInt
prefix replaced withPyLong
METH_OLDARGS
PyMember_Get()
PyMember_Set()
PyNumber_Coerce()
PyNumber_CoerceEx()
WITH_CYCLE_GC
- Many other C API removals.
PyThreadState.use_tracing
member_Py_CheckRecursionLimit
variable
PyTypeObject.tp_print
member_PyRuntime.getframe
member
- Heap type instances now store a strong reference to the type. Their dealloc
function must call
Py_DECREF(Py_TYPE(obj));
.
PyExc_RecursionErrorInst
variable
PyThreadState.tick_counter
member
PyCObject_Type
variable