]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-144270: Make SubElement parent and tag positional-only (GH-144845)
authorNeko Asakura <neko.asakura@outlook.com>
Mon, 30 Mar 2026 16:42:24 +0000 (00:42 +0800)
committerGitHub <noreply@github.com>
Mon, 30 Mar 2026 16:42:24 +0000 (19:42 +0300)
commitafd8113e9d7744e52ae82093628d373d6ecb9897
treee2fee2a93cb5eee47ba8009f5cb5063aa2a2066a
parent8e9d21c64b65edda99a0d38e8d23545b17f8455e
gh-144270: Make SubElement parent and tag positional-only (GH-144845)

The C accelerator implementations use PyArg_ParseTuple, which
inherently enforces positional-only parameters. The Python fallback
allowed these as keyword arguments, creating a behavioral mismatch.

Make the tag parameter of Element.__init__ and the parent and tag
parameters of SubElement positional-only to align with the C
accelerator.
Doc/library/xml.etree.elementtree.rst
Lib/test/test_xml_etree.py
Lib/xml/etree/ElementTree.py
Misc/NEWS.d/next/Library/2026-02-19-16-34-18.gh-issue-144270.wJRtSr.rst [new file with mode: 0644]