Skip to content

Missing docstrings on some objects in the xml.etree C implementation. #126273

Description

@pan324

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

Activity

  1. added
    docsDocumentation in the Doc dir
    on Nov 1, 2024
  2. 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
  3. serhiy-storchaka commented on Sep 1, 2026

    @serhiy-storchaka
    Member

    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).

  4. LeonxLJX commented on Sep 3, 2026

    @LeonxLJX

    I'd like to take this one.

    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?

    (claiming via @LeonxLJX)

  5. serhiy-storchaka commented on Sep 3, 2026

    @serhiy-storchaka
    Member

    @LeonxLJX Please, read the issue before posting such comments. There is already a PR, and the comment above mentions it.

  6. added a commit that references this issue on Sep 3, 2026
  7. added a commit that references this issue on Sep 12, 2026
  8. added a commit that references this issue on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions