changed the title [-]xml.etree Python docstrings are replaced by empty clinic docstrings [/-][+]Missing docstrings on some objects in the `xml.etree` C implementation.[/+]on Nov 1, 2024
PR #156783 copies the docstrings from the Python implementation: 24 methods of Element, TreeBuilder and XMLParser, plus the three class docstrings. The classes now also have a text signature, so help() and inspect.signature() work.
This supersedes the closed PR #126274. The main remark in its review -- that inaccurate docs should be fixed first and the docstrings aligned with them -- is why I started with #156766, which fixes several incorrect statements in the reference (including the description of keys() and items(), whose docstrings claimed to return a list).
Reading the issue, this looks like a documentation-clarity gap rather than a code defect: the current page doesn't give readers enough to self-diagnose, which is why it surfaces here as an issue instead of being answered by the docs.
Plan: locate the relevant section, confirm what the code actually does today (so the docs match behavior, not intent), tighten the wording, and scan neighboring pages for the same inconsistency — otherwise the fix just relocates the confusion.
One thing to confirm before writing: minimal correction scoped to this page, or also cross-link from related guides if the same gap shows up there?
Documentation
E.g. the code below shows a blank string for makeelement even though ElementTree.py does have docstrings:
import xml.etree.ElementTree as ET; help(ET.fromstring("<a></a>").makeelement)
Linked PRs