Skip to main content

Module compat

Module compat 

Available on crate feature tls only.
Expand description

C API Compatibility Shims

Some CPython C API functions added in recent versions of Python are inherently safer to use than older C API constructs. This module exposes functions available on all Python versions that wrap the old C API on old Python versions and wrap the function directly on newer Python versions.

Structs§

PyBytesWriterNeither Py_3_15 nor Py_LIMITED_API

Functions§

PyBytesWriter_Createdocsrs or not (Py_3_15 and non-Py_LIMITED_API)
PyBytesWriter_Discarddocsrs or not (Py_3_15 and non-Py_LIMITED_API)
PyBytesWriter_Finishdocsrs or not (Py_3_15 and non-Py_LIMITED_API)
PyBytesWriter_FinishWithSizedocsrs or not (Py_3_15 and non-Py_LIMITED_API)
PyBytesWriter_GetDatadocsrs or not (Py_3_15 and non-Py_LIMITED_API)
PyBytesWriter_GetSizedocsrs or not (Py_3_15 and non-Py_LIMITED_API)
PyBytesWriter_Resizedocsrs or not (Py_3_15 and non-Py_LIMITED_API)
PyDict_GetItemRefPy_3_13
PyImport_AddModuleRefPy_3_13
PyIter_NextItemPy_3_14
PyList_ClearPy_3_13
PyList_ExtendPy_3_13
PyList_GetItemRefPy_3_13
PyModule_AddPy_3_13
PyModule_AddObjectRefPy_3_10
PyObject_CallMethodNoArgsPy_3_9 and non-PyPy
PyObject_CallNoArgsNon-PyPy and (Py_3_10, or non-Py_LIMITED_API and Py_3_9)
PyThreadState_GetUncheckedPy_3_13
PyWeakref_GetRefPy_3_13
Py_HashBufferPy_3_14
Py_NewRefPy_3_10 and (non-Py_LIMITED_API or PyPy)
Py_XNewRefPy_3_10 and (non-Py_LIMITED_API or PyPy)