-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
See discussion: https://discuss.python.org/t/module-slot-for-checking-abi-compatibility/96443/
The checks we can do using C API are limited, but would still be useful, e.g. for the case of mixing up GIL-ful and free-threaded extensions/builds.
I propose adding:
PyABIInfostruct with:abiinfo_major_versionabiinfo_minor_versionflagswhich can be set to:PyABIInfo_DEFAULT_FLAGSPyABIInfo_STABLEPyABIInfo_INTERNALPyABIInfo_FREETHREADEDPyABIInfo_GIL
build_versionabi_version
int PyABIInfo_Check(PyABIInfo *info, const char *module_name)PyABIInfo_VAR(NAME)macro that defines a suitablePyABIInfovariablePy_mod_abi, a module slot that causes aPyABIInfo_Checkcall
C API WG vote pending: capi-workgroup/decisions#72
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-featureA feature request or enhancementA feature request or enhancement