Feature or enhancement
pyexpat.EXPAT_VERSION (from XML_ExpatVersion()) and pyexpat.version_info (from XML_ExpatVersionInfo()) describe the Expat library loaded at runtime: both functions are compiled into libexpat from its XML_MAJOR_VERSION, XML_MINOR_VERSION and XML_MICRO_VERSION macros. The same macros evaluated in pyexpat.c give the version of the headers the module was built against, which is what the #if XML_COMBINED_VERSION >= ... checks in the module depend on. The two can differ when a system libexpat is used. The build-time version is not exposed to Python; it can only be inferred from which parser methods exist.
Add pyexpat.VERSION_INFO for the build-time version, and make pyexpat.version_info a named tuple.
Linked PRs
Feature or enhancement
pyexpat.EXPAT_VERSION(fromXML_ExpatVersion()) andpyexpat.version_info(fromXML_ExpatVersionInfo()) describe the Expat library loaded at runtime: both functions are compiled into libexpat from itsXML_MAJOR_VERSION,XML_MINOR_VERSIONandXML_MICRO_VERSIONmacros. The same macros evaluated inpyexpat.cgive the version of the headers the module was built against, which is what the#if XML_COMBINED_VERSION >= ...checks in the module depend on. The two can differ when a system libexpat is used. The build-time version is not exposed to Python; it can only be inferred from which parser methods exist.Add
pyexpat.VERSION_INFOfor the build-time version, and makepyexpat.version_infoa named tuple.Linked PRs