René's URL Explorer Experiment


Title: gh-75646: allow _PyType_Lookup() to raise exceptions by scoder · Pull Request #3616 · python/cpython · GitHub

Open Graph Title: gh-75646: allow _PyType_Lookup() to raise exceptions by scoder · Pull Request #3616 · python/cpython

X Title: gh-75646: allow _PyType_Lookup() to raise exceptions by scoder · Pull Request #3616 · python/cpython

Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.

Open Graph Description: This is based off #3279, the first commits are the same, because they touch the same code. FIrst new commit is 6c61028, right after the merge of "master". 6c61028 is a related bug fix, an...

X Description: This is based off #3279, the first commits are the same, because they touch the same code. FIrst new commit is 6c61028, right after the merge of "master". 6c61028 is a related bug...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:062f03bd-320f-2cc6-5424-6b9def696e52
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDD8E:11479C:6F879:92F1E:6A595D72
html-safe-nonce164381fa6564632e1ed9b3462e60390f76b4629db7cf31f52b448d10b887a648
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDhFOjExNDc5Qzo2Rjg3OTo5MkYxRTo2QTU5NUQ3MiIsInZpc2l0b3JfaWQiOiI5MTA0NTY1MDM5ODQ0MTIxOTcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac0071768c3b7b29aac9f99857d62a1ba77ea81afcc1d8d2ec97abd3359160d39c
hovercard-subject-tagpull_request:141444074
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/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/3616/commits
twitter:imagehttps://opengraph.githubassets.com/908b88d3c20b80ec548be4d1b8b7bf2ebc3c089828a68f153eecfe16fa73f64a/python/cpython/pull/3616
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/908b88d3c20b80ec548be4d1b8b7bf2ebc3c089828a68f153eecfe16fa73f64a/python/cpython/pull/3616
og:image:altThis is based off #3279, the first commits are the same, because they touch the same code. FIrst new commit is 6c61028, right after the merge of "master". 6c61028 is a related bug fix, an...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamescoder
hostnamegithub.com
expected-hostnamegithub.com
Nonea540949572872b935b393b36db38922db390ae71c859537d741b8f3eb7e545b5
turbo-cache-controlno-cache
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef4669eb12cd81bf213b8907a42667725d1583c79
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/3616/commits#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F3616%2Fcommits
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%2F3616%2Fcommits
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%2Fcommits&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/3616/commits
Reloadhttps://github.com/python/cpython/pull/3616/commits
Reloadhttps://github.com/python/cpython/pull/3616/commits
Please reload this pagehttps://github.com/python/cpython/pull/3616/commits
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/3616/commits
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 34.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.8k 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
scoderhttps://github.com/scoder
python:mainhttps://github.com/python/cpython/tree/main
scoder:_pt_lookup_exchttps://github.com/scoder/cpython/tree/_pt_lookup_exc
Conversationhttps://github.com/python/cpython/pull/3616
Commits23 (23)https://github.com/python/cpython/pull/3616/commits
Checkshttps://github.com/python/cpython/pull/3616/checks
Files changedhttps://github.com/python/cpython/pull/3616/files
gh-75646: allow _PyType_Lookup() to raise exceptionshttps://github.com/python/cpython/pull/3616/commits#top
scoderhttps://github.com/scoder
python:mainhttps://github.com/python/cpython/tree/main
scoder:_pt_lookup_exchttps://github.com/scoder/cpython/tree/_pt_lookup_exc
Speed up type creation, which is highly dominated by slow dict lookups.https://github.com/python/cpython/pull/3616/commits/0a865c9309c6548fe6380500f02240d1995d3b16
0a865c9https://github.com/python/cpython/pull/3616/commits/0a865c9309c6548fe6380500f02240d1995d3b16
https://github.com/python/cpython/tree/0a865c9309c6548fe6380500f02240d1995d3b16
Update comment after changing the function call that it refers to.https://github.com/python/cpython/pull/3616/commits/c4779e3f7c06d1e53386f18e6bad3b045741369d
c4779e3https://github.com/python/cpython/pull/3616/commits/c4779e3f7c06d1e53386f18e6bad3b045741369d
https://github.com/python/cpython/tree/c4779e3f7c06d1e53386f18e6bad3b045741369d
Ignore any errors (however unlikely) that may happen during the mro chained name lookups in _PyType_Lookup().https://github.com/python/cpython/pull/3616/commits/ff2ea631ebc3b64f8785cfdbaa922cd3546bd1b1
ff2ea63https://github.com/python/cpython/pull/3616/commits/ff2ea631ebc3b64f8785cfdbaa922cd3546bd1b1
https://github.com/python/cpython/tree/ff2ea631ebc3b64f8785cfdbaa922cd3546bd1b1
Extract non-caching code from _PyType_Lookup() to use it directly from update_one_slot().https://github.com/python/cpython/pull/3616/commits/76b1986e093e9b236106df3abb7dfcd6f60e43ad
76b1986https://github.com/python/cpython/pull/3616/commits/76b1986e093e9b236106df3abb7dfcd6f60e43ad
https://github.com/python/cpython/tree/76b1986e093e9b236106df3abb7dfcd6f60e43ad
Avoid some useless overhead for the no-basetype case. If "object" ever ceases to be a valid base type, there'll probably be larger code sections to change than this one.https://github.com/python/cpython/pull/3616/commits/6f9848520ca858ae72d14ee99d0d86796b664981
6f98485https://github.com/python/cpython/pull/3616/commits/6f9848520ca858ae72d14ee99d0d86796b664981
https://github.com/python/cpython/tree/6f9848520ca858ae72d14ee99d0d86796b664981
Add comment.https://github.com/python/cpython/pull/3616/commits/d9b726e6ddaae31b01b41c33572e4f6f3fa1a63b
d9b726ehttps://github.com/python/cpython/pull/3616/commits/d9b726e6ddaae31b01b41c33572e4f6f3fa1a63b
https://github.com/python/cpython/tree/d9b726e6ddaae31b01b41c33572e4f6f3fa1a63b
Avoid uselessly searching empty bases for a metaclass. This is quite common in Python 3 now.https://github.com/python/cpython/pull/3616/commits/be15255ff763ce1018a7318590dc37a4c1e04a00
be15255https://github.com/python/cpython/pull/3616/commits/be15255ff763ce1018a7318590dc37a4c1e04a00
https://github.com/python/cpython/tree/be15255ff763ce1018a7318590dc37a4c1e04a00
Avoid unsafe handling of borrowed "mro" reference during hash() call.https://github.com/python/cpython/pull/3616/commits/0736226d67b43c70013a397be7157a7317b42057
0736226https://github.com/python/cpython/pull/3616/commits/0736226d67b43c70013a397be7157a7317b42057
https://github.com/python/cpython/tree/0736226d67b43c70013a397be7157a7317b42057
Clean up code and formatting a little.https://github.com/python/cpython/pull/3616/commits/8bc783f07e60c39afa464029b8d58443a0140137
8bc783fhttps://github.com/python/cpython/pull/3616/commits/8bc783f07e60c39afa464029b8d58443a0140137
https://github.com/python/cpython/tree/8bc783f07e60c39afa464029b8d58443a0140137
Add braces for code style reasons.https://github.com/python/cpython/pull/3616/commits/66648dd568cfefdf1f003bce8fc2aced4ec6972b
66648ddhttps://github.com/python/cpython/pull/3616/commits/66648dd568cfefdf1f003bce8fc2aced4ec6972b
https://github.com/python/cpython/tree/66648dd568cfefdf1f003bce8fc2aced4ec6972b
Give internal helper function a local name that does not resemble (existing) API names.https://github.com/python/cpython/pull/3616/commits/85fb3aedd4a878cbd18145c92b32a03c7fdcbfeb
85fb3aehttps://github.com/python/cpython/pull/3616/commits/85fb3aedd4a878cbd18145c92b32a03c7fdcbfeb
https://github.com/python/cpython/tree/85fb3aedd4a878cbd18145c92b32a03c7fdcbfeb
Allow non-dict types for the class dict when looking up names and call PyObject_GetItem() for them.https://github.com/python/cpython/pull/3616/commits/09e716a2e8eda777400da779c5a4f1b5e90375f6
09e716ahttps://github.com/python/cpython/pull/3616/commits/09e716a2e8eda777400da779c5a4f1b5e90375f6
https://github.com/python/cpython/tree/09e716a2e8eda777400da779c5a4f1b5e90375f6
Lazily calculate name hash in find_name_in_mro() to avoid potential re-calculation if the mapping is not exactly a dict.https://github.com/python/cpython/pull/3616/commits/1d52082bb544de02901f922242942253497cba58
1d52082https://github.com/python/cpython/pull/3616/commits/1d52082bb544de02901f922242942253497cba58
https://github.com/python/cpython/tree/1d52082bb544de02901f922242942253497cba58
Revert "Lazily calculate name hash in find_name_in_mro() to avoid potential re-calculation if the mapping is not exactly a dict."https://github.com/python/cpython/pull/3616/commits/f09bfd3fe764ae5cfb18c2a8b334964c76566c91
f09bfd3https://github.com/python/cpython/pull/3616/commits/f09bfd3fe764ae5cfb18c2a8b334964c76566c91
https://github.com/python/cpython/tree/f09bfd3fe764ae5cfb18c2a8b334964c76566c91
Revert "Allow non-dict types for the class dict when looking up names and call PyObject_GetItem() for them."https://github.com/python/cpython/pull/3616/commits/824d7cb25cd25368e9d04c5be5f75c8c790d8447
824d7cbhttps://github.com/python/cpython/pull/3616/commits/824d7cb25cd25368e9d04c5be5f75c8c790d8447
https://github.com/python/cpython/tree/824d7cb25cd25368e9d04c5be5f75c8c790d8447
add news entry for faster class creationhttps://github.com/python/cpython/pull/3616/commits/51841915d6f5f87c7f3559c7c83d0b2ce8ffebff
5184191https://github.com/python/cpython/pull/3616/commits/51841915d6f5f87c7f3559c7c83d0b2ce8ffebff
https://github.com/python/cpython/tree/51841915d6f5f87c7f3559c7c83d0b2ce8ffebff
Change nice interface of "find_name_in_mro()" to evil interface eating lookup exceptions, just like "_PyType_Lookup()" did previously.https://github.com/python/cpython/pull/3616/commits/4efde8ea72195e987a7946985b22725b1d8f4e3a
4efde8ehttps://github.com/python/cpython/pull/3616/commits/4efde8ea72195e987a7946985b22725b1d8f4e3a
https://github.com/python/cpython/tree/4efde8ea72195e987a7946985b22725b1d8f4e3a
Mention amount of speedup in News entry.https://github.com/python/cpython/pull/3616/commits/f5bce2a5494ee5856677d6345a55254e6cff2607
f5bce2ahttps://github.com/python/cpython/pull/3616/commits/f5bce2a5494ee5856677d6345a55254e6cff2607
https://github.com/python/cpython/tree/f5bce2a5494ee5856677d6345a55254e6cff2607
Revert "Change nice interface of "find_name_in_mro()" to evil interface eating lookup exceptions, just like "_PyType_Lookup()" did previously."https://github.com/python/cpython/pull/3616/commits/02bfef0f8dbe7b51e6f3c231c0d3d7a2554687ca
02bfef0https://github.com/python/cpython/pull/3616/commits/02bfef0f8dbe7b51e6f3c231c0d3d7a2554687ca
https://github.com/python/cpython/tree/02bfef0f8dbe7b51e6f3c231c0d3d7a2554687ca
Guard against external live exceptions when calling find_name_in_mro() from functions that swallow live exceptions.https://github.com/python/cpython/pull/3616/commits/24978587ccaebb90ac858c6285b6d793a47ed969
2497858https://github.com/python/cpython/pull/3616/commits/24978587ccaebb90ac858c6285b6d793a47ed969
https://github.com/python/cpython/tree/24978587ccaebb90ac858c6285b6d793a47ed969
Merge branch 'master' into _pt_lookup_exchttps://github.com/python/cpython/pull/3616/commits/c56990dc38f2a3c7b9a8356a0be210c7bf0b7549
c56990dhttps://github.com/python/cpython/pull/3616/commits/c56990dc38f2a3c7b9a8356a0be210c7bf0b7549
https://github.com/python/cpython/tree/c56990dc38f2a3c7b9a8356a0be210c7bf0b7549
Propagate exception when _PyObject_LookupSpecial() fails (as done everywhere else).https://github.com/python/cpython/pull/3616/commits/6c610287510e25479b18eca0fcca5b6e6178e628
6c61028https://github.com/python/cpython/pull/3616/commits/6c610287510e25479b18eca0fcca5b6e6178e628
https://github.com/python/cpython/tree/6c610287510e25479b18eca0fcca5b6e6178e628
Allow _PyType_Lookup() and _PyType_LookupId() to raise exceptions and handle them in the code that calls these functions.https://github.com/python/cpython/pull/3616/commits/1b5950faeef5cf0a733d004f078b0b0e0e1c6790
1b5950fhttps://github.com/python/cpython/pull/3616/commits/1b5950faeef5cf0a733d004f078b0b0e0e1c6790
https://github.com/python/cpython/tree/1b5950faeef5cf0a733d004f078b0b0e0e1c6790
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.