René's URL Explorer Experiment


Title: gh-161242: Use AC vectorcall for AttributeError, ImportError, NameError by cmaloney · Pull Request #161462 · python/cpython · GitHub

Open Graph Title: gh-161242: Use AC vectorcall for AttributeError, ImportError, NameError by cmaloney · Pull Request #161462 · python/cpython

X Title: gh-161242: Use AC vectorcall for AttributeError, ImportError, NameError by cmaloney · Pull Request #161462 · python/cpython

Description: These exceptions and their subclasses had no vectorcall, and __init__ parsed keywords through PyArg_ParseTupleAndKeywords with a temporary empty tuple on every call. Error messages are unchanged except when more keywords than parameters are given, which now names the unexpected keyword. The clinic inputs have no docstring, so docstrings are unchanged and these exceptions don't gain a __text_signature__. pyperf microbenchmark (PGO+LTO, run serially): Benchmark base vectorcall AttributeError(s, name=s, obj=s) 127 ns 41.9 ns: 3.02x faster ImportError(s, name=s, path=s) 129 ns 43.4 ns: 2.96x faster NameError(s, name=s) 88.3 ns 39.3 ns: 2.24x faster ModuleNotFoundError(s, name=s) 89.9 ns 40.6 ns: 2.21x faster AttributeError(s) 39.4 ns 32.1 ns: 1.23x faster UnboundLocalError(s) 38.6 ns 31.8 ns: 1.22x faster NameError(s) 38.5 ns 32.2 ns: 1.19x faster ImportError(s) 40.7 ns 34.4 ns: 1.18x faster attribute_error_to_none() 176 ns 173 ns: 1.02x faster Benchmark code: import pyperf runner = pyperf.Runner() setup = """s = 'x' class O: pass o = O() def attribute_error_to_none(): try: o.x except AttributeError: pass """ for stmt in ["AttributeError(s)", "AttributeError(s, name=s, obj=s)", "NameError(s)", "NameError(s, name=s)", "ImportError(s)", "ImportError(s, name=s, path=s)", "ModuleNotFoundError(s, name=s)", "UnboundLocalError(s)", "attribute_error_to_none()"]: runner.timeit(stmt, stmt, setup) Issue: gh-161242

Open Graph Description: These exceptions and their subclasses had no vectorcall, and __init__ parsed keywords through PyArg_ParseTupleAndKeywords with a temporary empty tuple on every call. Error messages are unchanged e...

X Description: These exceptions and their subclasses had no vectorcall, and __init__ parsed keywords through PyArg_ParseTupleAndKeywords with a temporary empty tuple on every call. Error messages are unchanged e...

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

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:14dcb765-801f-1d2e-3f77-cf397a006bf6
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA64C:28A483:19EEABF:223FE29:6B021736
html-safe-nonce2100c55dc780870de44e75a180297bad7d267e7cab5965c67c5b26232067a36c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjRDOjI4QTQ4MzoxOUVFQUJGOjIyM0ZFMjk6NkIwMjE3MzYiLCJ2aXNpdG9yX2lkIjoiODI1NTYxMTcwNjY1OTcwNjY3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0df66869644d8bcdd9a4dec7796f3887b0556ee30b62c6099e66281ae01cf030
hovercard-subject-tagpull_request:5183860514
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/161462/files
twitter:imagehttps://avatars.githubusercontent.com/u/751088?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/751088?s=400&v=4
og:image:altThese exceptions and their subclasses had no vectorcall, and __init__ parsed keywords through PyArg_ParseTupleAndKeywords with a temporary empty tuple on every call. Error messages are unchanged e...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/161462/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F161462%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F161462%2Ffiles
Sign uphttps://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/161462/files
Reloadhttps://github.com/python/cpython/pull/161462/files
Reloadhttps://github.com/python/cpython/pull/161462/files
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
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
cmaloneyhttps://github.com/cmaloney
python:mainhttps://github.com/python/cpython/tree/main
cmaloney:ac_vc_exc_kwhttps://github.com/cmaloney/cpython/tree/ac_vc_exc_kw
Conversation 6 https://github.com/python/cpython/pull/161462
Commits 4 https://github.com/python/cpython/pull/161462/commits
Checks 58 https://github.com/python/cpython/pull/161462/checks
Files changed https://github.com/python/cpython/pull/161462/files
Please reload this pagehttps://github.com/python/cpython/pull/161462/files
gh-161242: Use AC vectorcall for AttributeError, ImportError, NameError https://github.com/python/cpython/pull/161462/files#top
Show all changes 4 commits https://github.com/python/cpython/pull/161462/files
a50593d gh-161242: Use AC vectorcall for AttributeError, ImportError, NameError cmaloney Nov 3, 2026 https://github.com/python/cpython/pull/161462/commits/a50593dff7359c349e8f8cabbf1101abb3164fcd
adce6d0 Update test_call for the new ImportError keyword error message cmaloney Nov 6, 2026 https://github.com/python/cpython/pull/161462/commits/adce6d0d34d155a637ca5ae874167be2e2c4db10
d73995e Add NEWS cmaloney Nov 7, 2026 https://github.com/python/cpython/pull/161462/commits/d73995ef4a0b1aeb94a41a61ef561aed0be3bf71
16aa18f Add missing newline cmaloney Nov 7, 2026 https://github.com/python/cpython/pull/161462/commits/16aa18f3d7a76d4fd4cead5bba712b838e1a001e
Clear filters https://github.com/python/cpython/pull/161462/files
Please reload this pagehttps://github.com/python/cpython/pull/161462/files
Please reload this pagehttps://github.com/python/cpython/pull/161462/files
test_call.py https://github.com/python/cpython/pull/161462/files#diff-f27c08f13ff54ee9a69325f9291a3a2510a05b82ff8d813a8ab2e0072af632bb
2026-11-06-21-21-04.gh-issue-161242.d4vNgC.rst https://github.com/python/cpython/pull/161462/files#diff-523bdbda2a6751a118c9f1df96614c5fa368dadb054f09e77aaa9464641ebe90
exceptions.c.h https://github.com/python/cpython/pull/161462/files#diff-6c3cb7fa8dfda4d1a7b6917c541cc464ee79c9e65622baad76f930c7814f8d7b
exceptions.c https://github.com/python/cpython/pull/161462/files#diff-96c4ad902cdfac48712fef8fff0d0c78a71eb135fb48264f3ebb67db1013fc94
Lib/test/test_call.pyhttps://github.com/python/cpython/pull/161462/files#diff-f27c08f13ff54ee9a69325f9291a3a2510a05b82ff8d813a8ab2e0072af632bb
View file https://github.com/cmaloney/cpython/blob/16aa18f3d7a76d4fd4cead5bba712b838e1a001e/Lib/test/test_call.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/161462/{{ revealButtonHref }}
https://github.com/python/cpython/pull/161462/files#diff-f27c08f13ff54ee9a69325f9291a3a2510a05b82ff8d813a8ab2e0072af632bb
Please reload this pagehttps://github.com/python/cpython/pull/161462/files
https://github.com/python/cpython/pull/161462/files#diff-f27c08f13ff54ee9a69325f9291a3a2510a05b82ff8d813a8ab2e0072af632bb
Misc/NEWS.d/next/Core_and_Builtins/2026-11-06-21-21-04.gh-issue-161242.d4vNgC.rsthttps://github.com/python/cpython/pull/161462/files#diff-523bdbda2a6751a118c9f1df96614c5fa368dadb054f09e77aaa9464641ebe90
View file https://github.com/cmaloney/cpython/blob/16aa18f3d7a76d4fd4cead5bba712b838e1a001e/Misc/NEWS.d/next/Core_and_Builtins/2026-11-06-21-21-04.gh-issue-161242.d4vNgC.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/161462/{{ revealButtonHref }}
Objects/clinic/exceptions.c.hhttps://github.com/python/cpython/pull/161462/files#diff-6c3cb7fa8dfda4d1a7b6917c541cc464ee79c9e65622baad76f930c7814f8d7b
View file https://github.com/cmaloney/cpython/blob/16aa18f3d7a76d4fd4cead5bba712b838e1a001e/Objects/clinic/exceptions.c.h
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/cpython/pull/161462/files
Please reload this pagehttps://github.com/python/cpython/pull/161462/files
Please reload this pagehttps://github.com/python/cpython/pull/161462/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.