René's URL Explorer Experiment


Title: gh-144270: make SubElement parent and tag positional-only by NekoAsakura · Pull Request #144845 · python/cpython · GitHub

Open Graph Title: gh-144270: make SubElement parent and tag positional-only by NekoAsakura · Pull Request #144845 · python/cpython

X Title: gh-144270: make SubElement parent and tag positional-only by NekoAsakura · Pull Request #144845 · python/cpython

Description: Issue: #144270 Make parent and tag positional-only in xml.etree.ElementTree.SubElement to match the C accelerator. The C implementation (_elementtree.SubElement) uses PyArg_ParseTuple, which inherently makes parent and tag positional-only. The Python fallback used def SubElement(parent, tag, attrib={}, **extra): which allowed parent and tag as keyword arguments. This inconsistency meant SubElement(parent=e, tag="x") worked only when the C accelerator was unavailable. Fix: add / after tag → def SubElement(parent, tag, /, attrib={}, **extra): Changes Lib/xml/etree/ElementTree.py: add / to SubElement signature Lib/test/test_xml_etree.py: add test_subelement covering positional-only enforcement, keyword attrib, and kwargs-as-XML-attributes parity Doc/library/xml.etree.elementtree.rst: update signature and add versionchanged:: 3.15 Note Element.__init__ has the same Python/C signature mismatch — tag is positional-only in the C version (PyArg_ParseTuple at _elementtree.c:419) but accepts keywords in the Python fallback (ElementTree.py:167). I will create a separate issue for that to keep this PR focused. cpython/Lib/xml/etree/ElementTree.py Line 167 in 23c488d def __init__(self, tag, attrib={}, **extra): cpython/Modules/_elementtree.c Lines 419 to 420 in 23c488d if (!PyArg_ParseTuple(args, "O|O!:Element", &tag, &PyDict_Type, &attrib)) return -1; Issue: gh-144270 📚 Documentation preview 📚: https://cpython-previews--144845.org.readthedocs.build/

Open Graph Description: Issue: #144270 Make parent and tag positional-only in xml.etree.ElementTree.SubElement to match the C accelerator. The C implementation (_elementtree.SubElement) uses PyArg_ParseTuple, which inhere...

X Description: Issue: #144270 Make parent and tag positional-only in xml.etree.ElementTree.SubElement to match the C accelerator. The C implementation (_elementtree.SubElement) uses PyArg_ParseTuple, which inhere...

Opengraph URL: https://github.com/python/cpython/pull/144845

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:2de4def5-1021-c990-8d66-212f41b2f811
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9512:32DCA7:1DB7DD:28C617:6A513326
html-safe-nonce809e7759f396a7fc75ed8feb6cf748760700894374f919a810e4a723a69f2888
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTEyOjMyRENBNzoxREI3REQ6MjhDNjE3OjZBNTEzMzI2IiwidmlzaXRvcl9pZCI6IjgzMTA1MzkyMTMzNDE0NTgzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacaee67f6f584ebc83777d51f4b4af81c2b803ed204d103f88748b3c270c465f01
hovercard-subject-tagpull_request:3287292545
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/144845/files
twitter:imagehttps://avatars.githubusercontent.com/u/72689291?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/72689291?s=400&v=4
og:image:altIssue: #144270 Make parent and tag positional-only in xml.etree.ElementTree.SubElement to match the C accelerator. The C implementation (_elementtree.SubElement) uses PyArg_ParseTuple, which inhere...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonee840f405b2718e8f2d55aafa9ff27dbce17e29d0c253011d05ea0fea3c78baff
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4ae6027e8ba70c79dc08249bb6cdc1a09d788496
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/144845/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F144845%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F144845%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/144845/files
Reloadhttps://github.com/python/cpython/pull/144845/files
Reloadhttps://github.com/python/cpython/pull/144845/files
Please reload this pagehttps://github.com/python/cpython/pull/144845/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/144845/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.7k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
serhiy-storchakahttps://github.com/serhiy-storchaka
python:mainhttps://github.com/python/cpython/tree/main
NekoAsakura:gh-144270-subelement-positional-onlyhttps://github.com/NekoAsakura/cpython/tree/gh-144270-subelement-positional-only
Conversation 9 https://github.com/python/cpython/pull/144845
Commits 2 https://github.com/python/cpython/pull/144845/commits
Checks 51 https://github.com/python/cpython/pull/144845/checks
Files changed https://github.com/python/cpython/pull/144845/files
Please reload this pagehttps://github.com/python/cpython/pull/144845/files
gh-144270: make SubElement parent and tag positional-only https://github.com/python/cpython/pull/144845/files#top
Show all changes 2 commits https://github.com/python/cpython/pull/144845/files
38af9cf gh-144270: make Element and SubElement parameters positional-only NekoAsakura Feb 19, 2026 https://github.com/python/cpython/pull/144845/commits/38af9cf03a6f7a036292167749e6baff8cd7285d
6f43dc8 Merge remote-tracking branch 'upstream/main' into gh-144270-subelemen… NekoAsakura Mar 30, 2026 https://github.com/python/cpython/pull/144845/commits/6f43dc8d39eb471fa8888d81510c28d38e65c349
Clear filters https://github.com/python/cpython/pull/144845/files
Please reload this pagehttps://github.com/python/cpython/pull/144845/files
Please reload this pagehttps://github.com/python/cpython/pull/144845/files
xml.etree.elementtree.rst https://github.com/python/cpython/pull/144845/files#diff-9f6d65f8cd6bc51eb67fc1894e1c462159a62f370e2d99dafe4b10ebca41160f
test_xml_etree.py https://github.com/python/cpython/pull/144845/files#diff-cd2315ff25ab49e653d363de2d213e390ecb1b01bbc86e2be3b700db4b0bf454
ElementTree.py https://github.com/python/cpython/pull/144845/files#diff-6cc017478b4d1fa353b3869176b34a540106a61462417ba0ee1a77fc64eef673
2026-02-19-16-34-18.gh-issue-144270.wJRtSr.rst https://github.com/python/cpython/pull/144845/files#diff-91cf551e87d005335f5479f9a40dfde122425365af357431a5ef89db4d818374
Doc/library/xml.etree.elementtree.rsthttps://github.com/python/cpython/pull/144845/files#diff-9f6d65f8cd6bc51eb67fc1894e1c462159a62f370e2d99dafe4b10ebca41160f
View file https://github.com/NekoAsakura/cpython/blob/6f43dc8d39eb471fa8888d81510c28d38e65c349/Doc/library/xml.etree.elementtree.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/144845/{{ revealButtonHref }}
https://github.com/python/cpython/pull/144845/files#diff-9f6d65f8cd6bc51eb67fc1894e1c462159a62f370e2d99dafe4b10ebca41160f
https://github.com/python/cpython/pull/144845/files#diff-9f6d65f8cd6bc51eb67fc1894e1c462159a62f370e2d99dafe4b10ebca41160f
https://github.com/python/cpython/pull/144845/files#diff-9f6d65f8cd6bc51eb67fc1894e1c462159a62f370e2d99dafe4b10ebca41160f
https://github.com/python/cpython/pull/144845/files#diff-9f6d65f8cd6bc51eb67fc1894e1c462159a62f370e2d99dafe4b10ebca41160f
https://github.com/python/cpython/pull/144845/files#diff-9f6d65f8cd6bc51eb67fc1894e1c462159a62f370e2d99dafe4b10ebca41160f
https://github.com/python/cpython/pull/144845/files#diff-9f6d65f8cd6bc51eb67fc1894e1c462159a62f370e2d99dafe4b10ebca41160f
Lib/test/test_xml_etree.pyhttps://github.com/python/cpython/pull/144845/files#diff-cd2315ff25ab49e653d363de2d213e390ecb1b01bbc86e2be3b700db4b0bf454
View file https://github.com/NekoAsakura/cpython/blob/6f43dc8d39eb471fa8888d81510c28d38e65c349/Lib/test/test_xml_etree.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/144845/{{ revealButtonHref }}
https://github.com/python/cpython/pull/144845/files#diff-cd2315ff25ab49e653d363de2d213e390ecb1b01bbc86e2be3b700db4b0bf454
https://github.com/python/cpython/pull/144845/files#diff-cd2315ff25ab49e653d363de2d213e390ecb1b01bbc86e2be3b700db4b0bf454
https://github.com/python/cpython/pull/144845/files#diff-cd2315ff25ab49e653d363de2d213e390ecb1b01bbc86e2be3b700db4b0bf454
Please reload this pagehttps://github.com/python/cpython/pull/144845/files
https://github.com/python/cpython/pull/144845/files#diff-cd2315ff25ab49e653d363de2d213e390ecb1b01bbc86e2be3b700db4b0bf454
Lib/xml/etree/ElementTree.pyhttps://github.com/python/cpython/pull/144845/files#diff-6cc017478b4d1fa353b3869176b34a540106a61462417ba0ee1a77fc64eef673
View file https://github.com/NekoAsakura/cpython/blob/6f43dc8d39eb471fa8888d81510c28d38e65c349/Lib/xml/etree/ElementTree.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/144845/{{ revealButtonHref }}
https://github.com/python/cpython/pull/144845/files#diff-6cc017478b4d1fa353b3869176b34a540106a61462417ba0ee1a77fc64eef673
https://github.com/python/cpython/pull/144845/files#diff-6cc017478b4d1fa353b3869176b34a540106a61462417ba0ee1a77fc64eef673
https://github.com/python/cpython/pull/144845/files#diff-6cc017478b4d1fa353b3869176b34a540106a61462417ba0ee1a77fc64eef673
https://github.com/python/cpython/pull/144845/files#diff-6cc017478b4d1fa353b3869176b34a540106a61462417ba0ee1a77fc64eef673
Misc/NEWS.d/next/Library/2026-02-19-16-34-18.gh-issue-144270.wJRtSr.rsthttps://github.com/python/cpython/pull/144845/files#diff-91cf551e87d005335f5479f9a40dfde122425365af357431a5ef89db4d818374
View file https://github.com/NekoAsakura/cpython/blob/6f43dc8d39eb471fa8888d81510c28d38e65c349/Misc/NEWS.d/next/Library/2026-02-19-16-34-18.gh-issue-144270.wJRtSr.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/144845/{{ revealButtonHref }}
Please reload this pagehttps://github.com/python/cpython/pull/144845/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.