Skip to content

Conversation

@picnixz
Copy link
Member

@picnixz picnixz commented Nov 8, 2025

The Expat C API does not store a global variable as other C APIs and instead prefer consumers to add both the capsule and the C API pointer in the consumer's state. I don't really llike this but it's probably the best


📚 Documentation preview 📚: https://cpython-previews--141259.org.readthedocs.build/

@bedevere-app bedevere-app bot added awaiting core review docs Documentation in the Doc dir labels Nov 8, 2025
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Nov 8, 2025
@picnixz picnixz force-pushed the docs/capi/expat-141004 branch from 6164db5 to dc77ab0 Compare November 8, 2025 17:15
@picnixz picnixz force-pushed the docs/capi/expat-141004 branch from dc77ab0 to 5b857a4 Compare November 8, 2025 17:18
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on these!

Comment on lines +67 to +68
static inline int
PyExpat_CheckCompatibility(struct PyExpat_CAPI *api)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eek, this looks like a new feature. We can add this for 3.15, but we should instead document the recipe for older versions.

Comment on lines +227 to +247
nitpick_ignore += [
("c:identifier", "XML_Bool"),
("c:identifier", "XML_Char"),
("c:identifier", "XML_CharacterDataHandler"),
("c:identifier", "XML_CommentHandler"),
("c:identifier", "XML_DefaultHandler"),
("c:identifier", "XML_Encoding"),
("c:identifier", "XML_EndElementHandler"),
("c:identifier", "XML_EndNamespaceDeclHandler"),
("c:identifier", "XML_Error"),
("c:identifier", "XML_LChar"),
("c:identifier", "XML_Memory_Handling_Suite"),
("c:identifier", "XML_Parser"),
("c:identifier", "XML_ProcessingInstructionHandler"),
("c:identifier", "XML_Size"),
("c:identifier", "XML_StartDoctypeDeclHandler"),
("c:identifier", "XML_StartElementHandler"),
("c:identifier", "XML_StartNamespaceDeclHandler"),
("c:identifier", "XML_Status"),
("c:identifier", "XML_UnknownEncodingHandler"),
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why isn't Sphinx happy with these?

XML_Parser parser,\
unsigned long hash_salt)
Might be NULL for Expat versions prior to 2.1.0.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you, but I'd prefer that we use inline code blocks for NULL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants