Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
gh-140771: Add class directive for xmlparser in pyexpat docs#144456
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
Conversation
Add a class directive for xmlparser so that all the :class:`xmlparser`references in the documentation resolve properly. Document that thetype is available as xml.parsers.expat.XMLParserType.Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
picnixz 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.
xmlparser does not exist at runtime so we can't document it here. We need an another way to make references work but that may require a Sphinx change.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
kovan commentedFeb 4, 2026
The class does exist at runtime - it's just accessed via >>>importxml.parsers.expatasexpat>>>expat.XMLParserType<class'pyexpat.xmlparser'>>>>expat.XMLParserType.__name__'xmlparser'>>> type(expat.ParserCreate())<class'pyexpat.xmlparser'> The documentation already uses The note in my PR already clarifies the access pattern:
Would this approach be acceptable, or do you prefer changing all 30+ references from |
picnixz commentedFeb 4, 2026
The name does not exist. We don't document objects that don't exist at runtime. You can't do
I want to think about it differently. Ideally, I'd like to have a real |
kovan commentedFeb 4, 2026 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The thing is, I am an action man, you know. And Python has 5000+! open issues, so plenty of room to work here. |
kovan commentedFeb 4, 2026 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Also, the debate can be in the PRs, that's fine for me. I can make edits on the PRs as the conversation evolves. |
picnixz commentedFeb 4, 2026
No, debate is in the issue. |
picnixz commentedFeb 4, 2026
Yes, but you need to be careful. If you just generate PRs with AI, we won't accept them because it takes time to review them. I prefer having 5k+ issues open rather than lots of low-quality PRs generated by an LLM. |
kovan commentedFeb 4, 2026
Yeah, but 5000+ open issues is just not acceptable. |
Uh oh!
There was an error while loading.Please reload this page.
Summary
.. class:: xmlparserdirective so that all:class:xmlparser`` references in the documentation resolve properlyxml.parsers.expat.XMLParserTypeXMLParserTypeto be documented as an alias for the classThis fixes the broken cross-references throughout the pyexpat documentation.
Test plan
make checkpassed🤖 Generated withClaude Code
📚 Documentation preview 📚:https://cpython-previews--144456.org.readthedocs.build/