Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-141004: documentpyexpat C API#141259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
6164db5 todc77ab0Comparedc77ab0 to5b857a4Compare
ZeroIntensity left a comment
There was a problem hiding this 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!
| staticinlineint | ||
| PyExpat_CheckCompatibility(structPyExpat_CAPI*api) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes. I will probably split the PR tomorrow but I wanted to have it here to understand why it exists :)
| 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"), | ||
| ] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Because they are in the signature of the functions:
..c:function:: some_rtypesomething(some_type some_param)
It tries to make a cross-reference tosome_type. The C domain is not really friendly when it comes to document interfaces with types that are outside the project and when the external project does not have an intersphinx inventory (we don't use intersphinx either)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Ah, ok. If only there were Sphinx maintainers on the core team that could make this easier! :)
| XML_Parser parser,\ | ||
| unsignedlong hash_salt) | ||
| Might be NULL for Expat versions prior to 2.1.0. |
There was a problem hiding this comment.
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 forNULL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Good catch!
Uh oh!
There was an error while loading.Please reload this page.
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/