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_Create⚠docsrs or not (Py_3_15 and non-Py_LIMITED_API)
PyBytesWriter_Discard⚠docsrs or not (Py_3_15 and non-Py_LIMITED_API)
PyBytesWriter_Finish⚠docsrs or not (Py_3_15 and non-Py_LIMITED_API)
PyBytesWriter_FinishWithSize⚠docsrs or not (Py_3_15 and non-Py_LIMITED_API)
PyBytesWriter_GetData⚠docsrs or not (Py_3_15 and non-Py_LIMITED_API)
PyBytesWriter_GetSize⚠docsrs or not (Py_3_15 and non-Py_LIMITED_API)
PyBytesWriter_Resize⚠docsrs or not (Py_3_15 and non-Py_LIMITED_API)
PyDict_GetItemRef⚠docsrs or non-Py_3_13
PyImport_AddModuleRef⚠docsrs or non-Py_3_13
PyIter_NextItem⚠docsrs or non-Py_3_14
PyList_Clear⚠docsrs or non-Py_3_13
PyList_Extend⚠docsrs or non-Py_3_13
PyList_GetItemRef⚠docsrs or non-Py_3_13
PyModule_Add⚠docsrs or non-Py_3_13
PyModule_AddObjectRef⚠Py_3_10
PyObject_CallMethodNoArgs⚠Py_3_9 and non-PyPy
PyObject_CallNoArgs⚠(Py_3_10, or Py_3_9 and non-Py_LIMITED_API) and non-PyPy
PyThreadState_GetUnchecked⚠docsrs or non-Py_3_13
PyWeakref_GetRef⚠docsrs or non-Py_3_13
Py_HashBuffer⚠docsrs or not (Py_3_14 and non-Py_LIMITED_API)
Py_NewRef⚠Py_3_10 and (PyPy or non-Py_LIMITED_API)
Py_XNewRef⚠Py_3_10 and (PyPy or non-Py_LIMITED_API)