Skip to content

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

Merged
serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-09ff4d4-3.13
Sep 2, 2026
Merged

[3.13] gh-156765: Fix inaccuracies in the ElementTree documentation (GH-156766)#156850
serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-09ff4d4-3.13

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Sep 2, 2026

Copy link
Copy Markdown
Member

Manual backport of #156766: the versionchanged:: 3.15 notes of the Element class do not apply to 3.13.

(cherry picked from commit 09ff4d4)

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

…tion (pythonGH-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>
@serhiy-storchaka
serhiy-storchaka merged commit 798da2c into python:3.13 Sep 2, 2026
45 of 48 checks passed
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.

1 participant