Skip to content

[3.15] gh-156765: Fix inaccuracies in the ElementTree documentation (GH-156766) - #156848

Merged
serhiy-storchaka merged 1 commit into
python:3.15from
miss-islington:backport-09ff4d4-3.15
Oct 10, 2026
Merged

serhiy-storchaka merged 1 commit into
python:3.15from
miss-islington:backport-09ff4d4-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Corrected:

  • the parser argument of iterparse() is an instance of XMLParser or its
    subclass, not a subclass;
  • feed() accepts a string as well as encoded data;
  • keys() and items() do not return a list in the Python implementation, and
    the attributes are no longer returned in an arbitrary order.

Removed the claims that the element tag, the attribute names and values, the
text of a comment and the data of TreeBuilder.data() can be bytes. It is a
Python 2 leftover. Documented instead what they can be.
(cherry picked from commit 09ff4d4)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com

…ythonGH-156766)

Corrected:

* the parser argument of iterparse() is an instance of XMLParser or its
  subclass, not a subclass;
* feed() accepts a string as well as encoded data;
* keys() and items() do not return a list in the Python implementation, and
  the attributes are no longer returned in an arbitrary order.

Removed the claims that the element tag, the attribute names and values, the
text of a comment and the data of TreeBuilder.data() can be bytes.  It is a
Python 2 leftover.  Documented instead what they can be.
(cherry picked from commit 09ff4d4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@read-the-docs-community

Copy link
Copy Markdown

@serhiy-storchaka
serhiy-storchaka merged commit e2524cf into python:3.15 Oct 10, 2026
61 checks passed
@miss-islington
miss-islington deleted the backport-09ff4d4-3.15 branch October 10, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants