Skip to content

Provide PyExpat_CheckCompatibility to check C API compatibility #141297

@picnixz

Description

@picnixz

Feature or enhancement

Proposal:

In #141259, I provide a recipe for checking compatibility of the Expat API with the one that was linked for Python. However, the recipe is quite complex and I think we should provide a minimal function that checks the simple compatibility (magic number, Expat versions and structure size).

The idea is that consumers call this function but they should set the exception themselves because they might want to have other checks that are only compatible afterwards. We can also expose it as a private unstable function in case we need to change it later.

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

#141259 (comment)

Linked PRs

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions