René's URL Explorer Experiment


Title: GH-100762: Don't call `gen.throw()` in `gen.close()`, unless necessary. by markshannon · Pull Request #101013 · python/cpython · GitHub

Open Graph Title: GH-100762: Don't call `gen.throw()` in `gen.close()`, unless necessary. by markshannon · Pull Request #101013 · python/cpython

X Title: GH-100762: Don't call `gen.throw()` in `gen.close()`, unless necessary. by markshannon · Pull Request #101013 · python/cpython

Description: Change oparg of YIELD_VALUE to hold the exception handler depth. We can then test that in gen.close() to avoid calling gen.throw() unless necessary. Issue: Generator finalization is slower in 3.1...

Open Graph Description: Change oparg of YIELD_VALUE to hold the exception handler depth. We can then test that in gen.close() to avoid calling gen.throw() unless necessary. Issue: Generator finalization is slower in 3.1...

X Description: Change oparg of YIELD_VALUE to hold the exception handler depth. We can then test that in gen.close() to avoid calling gen.throw() unless necessary. Issue: Generator finalization is slower in 3.1...

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

X: @github

direct link

Domain: github.com

route-pattern/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:fdee0561-9297-369e-b6d3-aac423b36f81
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA400:1B38B1:3D1C6F2:5023806:696BA691
html-safe-nonce083de68fcc255a7c4913e4260f332e7f4a87f8615d2f9c63afa7b5e13d594207
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDAwOjFCMzhCMTozRDFDNkYyOjUwMjM4MDY6Njk2QkE2OTEiLCJ2aXNpdG9yX2lkIjoiNDY2NjI1MzcyNTcyMDYxODY0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac6eb293a4b899680f22a49b987ffb776ac7d5e52728f861b8648b0a16d1e2c8d5
hovercard-subject-tagpull_request:1196805697
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///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/python/cpython/101013/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/488757b3c70dc8c5fad35d742924a21c49fe7721b9c5ec0b17c939d80e2a2490/python/cpython/pull/101013
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/488757b3c70dc8c5fad35d742924a21c49fe7721b9c5ec0b17c939d80e2a2490/python/cpython/pull/101013
og:image:altChange oparg of YIELD_VALUE to hold the exception handler depth. We can then test that in gen.close() to avoid calling gen.throw() unless necessary. Issue: Generator finalization is slower in 3.1...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemarkshannon
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
turbo-cache-controlno-preview
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
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/101013#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F101013
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
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
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
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/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%2F101013
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%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/101013
Reloadhttps://github.com/python/cpython/pull/101013
Reloadhttps://github.com/python/cpython/pull/101013
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/101013
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k 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.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/101013
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 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
Jump to bottomhttps://github.com/python/cpython/pull/101013#issue-comment-box
markshannonhttps://github.com/markshannon
python:mainhttps://github.com/python/cpython/tree/main
faster-cpython:faster-gen-closehttps://github.com/faster-cpython/cpython/tree/faster-gen-close
GH-100762: Don't call gen.throw() in gen.close(), unless necessary. https://github.com/python/cpython/pull/101013#top
markshannonhttps://github.com/markshannon
python:mainhttps://github.com/python/cpython/tree/main
faster-cpython:faster-gen-closehttps://github.com/faster-cpython/cpython/tree/faster-gen-close
Conversation 19 https://github.com/python/cpython/pull/101013
Commits 7 https://github.com/python/cpython/pull/101013/commits
Checks 0 https://github.com/python/cpython/pull/101013/checks
Files changed https://github.com/python/cpython/pull/101013/files
Please reload this pagehttps://github.com/python/cpython/pull/101013
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
https://github.com/markshannon
markshannonhttps://github.com/markshannon
Jan 13, 2023https://github.com/python/cpython/pull/101013#issue-1532397791
Please reload this pagehttps://github.com/python/cpython/pull/101013
Generator finalization is slower in 3.11 vs 3.10 #100762https://github.com/python/cpython/issues/100762
Please reload this pagehttps://github.com/python/cpython/pull/101013
markshannonhttps://github.com/markshannon
January 13, 2023 12:44https://github.com/python/cpython/pull/101013#commits-pushed-5b081f2
https://github.com/markshannon
Store exception stack depth in YIELD_VALUE's oparg and use it avoid e…https://github.com/python/cpython/pull/101013/commits/5b081f2b1c4b6628c1886d6908313893e34c9aed
5b081f2https://github.com/python/cpython/pull/101013/commits/5b081f2b1c4b6628c1886d6908313893e34c9aed
https://github.com/markshannon
Add newshttps://github.com/python/cpython/pull/101013/commits/6ec191a180c781a3d3432a525fb09d3cee959986
6ec191ahttps://github.com/python/cpython/pull/101013/commits/6ec191a180c781a3d3432a525fb09d3cee959986
https://github.com/markshannon
markshannonhttps://github.com/markshannon
brandtbucherhttps://github.com/brandtbucher
January 13, 2023 14:37https://github.com/python/cpython/pull/101013#event-8221408918
https://github.com/markshannon
markshannonhttps://github.com/markshannon
iritkatrielhttps://github.com/iritkatriel
code ownerhttps://github.com/python/cpython/blob/e5bd5ad70d9e549eeb80aadb4f3ccb0f2f23266d/.github/CODEOWNERS#L24
January 13, 2023 14:37https://github.com/python/cpython/pull/101013#event-8221408986
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Jan 13, 2023https://github.com/python/cpython/pull/101013#event-8221409353
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
Jan 13, 2023 https://github.com/python/cpython/pull/101013#ref-issue-1519758243
Generator finalization is slower in 3.11 vs 3.10 #100762 https://github.com/python/cpython/issues/100762
https://github.com/markshannon
Don't skip throwing if sub-generator raises.https://github.com/python/cpython/pull/101013/commits/044f2cf07c97386a0de8b10bf8419cf54dad13eb
044f2cfhttps://github.com/python/cpython/pull/101013/commits/044f2cf07c97386a0de8b10bf8419cf54dad13eb
https://github.com/markshannon
markshannonhttps://github.com/markshannon
Jan 13, 2023https://github.com/python/cpython/pull/101013#issuecomment-1381977555
Please reload this pagehttps://github.com/python/cpython/pull/101013
#101011 (comment)https://github.com/python/cpython/pull/101011#issue-1532104206
Please reload this pagehttps://github.com/python/cpython/pull/101013
https://github.com/brandtbucher
brandtbucherhttps://github.com/brandtbucher
Jan 18, 2023 https://github.com/python/cpython/pull/101013#pullrequestreview-1252668438
View reviewed changes https://github.com/python/cpython/pull/101013/files/044f2cf07c97386a0de8b10bf8419cf54dad13eb
Lib/importlib/_bootstrap_external.pyhttps://github.com/python/cpython/pull/101013/files/044f2cf07c97386a0de8b10bf8419cf54dad13eb#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
Please reload this pagehttps://github.com/python/cpython/pull/101013
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
awaiting merge https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20merge%22
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Jan 18, 2023https://github.com/python/cpython/pull/101013#event-8251166236
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
Jan 18, 2023 https://github.com/python/cpython/pull/101013#pullrequestreview-1260944651
View reviewed changes https://github.com/python/cpython/pull/101013/files/044f2cf07c97386a0de8b10bf8419cf54dad13eb
Doc/library/dis.rsthttps://github.com/python/cpython/pull/101013/files/044f2cf07c97386a0de8b10bf8419cf54dad13eb#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
Please reload this pagehttps://github.com/python/cpython/pull/101013
markshannonhttps://github.com/markshannon
January 23, 2023 16:47https://github.com/python/cpython/pull/101013#commits-pushed-720f241
https://github.com/markshannon
Merge branch 'main' into faster-gen-closehttps://github.com/python/cpython/pull/101013/commits/720f24152d0fb942234189b0b90fa051167d4618
720f241https://github.com/python/cpython/pull/101013/commits/720f24152d0fb942234189b0b90fa051167d4618
https://github.com/markshannon
Restore note about 3.11 change.https://github.com/python/cpython/pull/101013/commits/dfd884ea94f771cb274258e555aecf556e0d5f33
dfd884ehttps://github.com/python/cpython/pull/101013/commits/dfd884ea94f771cb274258e555aecf556e0d5f33
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
Jan 23, 2023 https://github.com/python/cpython/pull/101013#pullrequestreview-1266447702
View reviewed changes https://github.com/python/cpython/pull/101013/files/dfd884ea94f771cb274258e555aecf556e0d5f33
gvanrossumhttps://github.com/gvanrossum
https://github.com/python/cpython/pull/101013#pullrequestreview-1266447702
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/101013
Objects/genobject.chttps://github.com/python/cpython/pull/101013/files/dfd884ea94f771cb274258e555aecf556e0d5f33#diff-2a0c449b68605ebd0872fd232e60ce7e838a77782a6d2e364764f99514fb508a
Please reload this pagehttps://github.com/python/cpython/pull/101013
Python/compile.chttps://github.com/python/cpython/pull/101013/files/dfd884ea94f771cb274258e555aecf556e0d5f33#diff-ebc983d9f91e5bcf73500e377ac65e85863c4f77fd5b6b6caf4fcdf7c0f0b057
Please reload this pagehttps://github.com/python/cpython/pull/101013
Objects/genobject.chttps://github.com/python/cpython/pull/101013/files/dfd884ea94f771cb274258e555aecf556e0d5f33#diff-2a0c449b68605ebd0872fd232e60ce7e838a77782a6d2e364764f99514fb508a
Please reload this pagehttps://github.com/python/cpython/pull/101013
Lib/importlib/_bootstrap_external.pyhttps://github.com/python/cpython/pull/101013/files/dfd884ea94f771cb274258e555aecf556e0d5f33#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
Please reload this pagehttps://github.com/python/cpython/pull/101013
https://github.com/brandtbucher
brandtbucherhttps://github.com/brandtbucher
Jan 24, 2023https://github.com/python/cpython/pull/101013#issuecomment-1401205564
Please reload this pagehttps://github.com/python/cpython/pull/101013
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
Jan 24, 2023https://github.com/python/cpython/pull/101013#issuecomment-1401206365
Please reload this pagehttps://github.com/python/cpython/pull/101013
markshannonhttps://github.com/markshannon
January 24, 2023 15:53https://github.com/python/cpython/pull/101013#commits-pushed-5b6eb20
https://github.com/markshannon
Update metadatahttps://github.com/python/cpython/pull/101013/commits/5b6eb20f7fd032e93c2d25c17b2952bd6a948893
5b6eb20https://github.com/python/cpython/pull/101013/commits/5b6eb20f7fd032e93c2d25c17b2952bd6a948893
https://github.com/markshannon
Fix typohttps://github.com/python/cpython/pull/101013/commits/f5ac751d8ff345b8a79c892d47e9770c4e88fb32
f5ac751https://github.com/python/cpython/pull/101013/commits/f5ac751d8ff345b8a79c892d47e9770c4e88fb32
https://github.com/markshannon
markshannonhttps://github.com/markshannon
needs backport to 3.11 https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22needs%20backport%20to%203.11%22
Jan 24, 2023https://github.com/python/cpython/pull/101013#event-8346611140
https://github.com/markshannon
markshannonhttps://github.com/markshannon
f02fa64https://github.com/python/cpython/commit/f02fa64bf2d03ef7a28650c164e17a5fb5d8543d
Jan 24, 2023https://github.com/python/cpython/pull/101013#event-8346615796
https://github.com/miss-islington
miss-islingtonhttps://github.com/miss-islington
Jan 24, 2023https://github.com/python/cpython/pull/101013#issuecomment-1402317427
@markshannonhttps://github.com/markshannon
Please reload this pagehttps://github.com/python/cpython/pull/101013
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
awaiting merge https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20merge%22
Jan 24, 2023https://github.com/python/cpython/pull/101013#event-8346616314
https://github.com/miss-islington
miss-islingtonhttps://github.com/miss-islington
Jan 24, 2023https://github.com/python/cpython/pull/101013#issuecomment-1402317652
@markshannonhttps://github.com/markshannon
cherry_pickerhttps://pypi.org/project/cherry-picker/
Please reload this pagehttps://github.com/python/cpython/pull/101013
https://github.com/miss-islington
miss-islingtonhttps://github.com/miss-islington
markshannonhttps://github.com/markshannon
Jan 24, 2023https://github.com/python/cpython/pull/101013#event-8346617443
https://github.com/brandtbucher
brandtbucherhttps://github.com/brandtbucher
Jan 24, 2023https://github.com/python/cpython/pull/101013#issuecomment-1402324197
Please reload this pagehttps://github.com/python/cpython/pull/101013
https://github.com/markshannon
markshannonhttps://github.com/markshannon
Jan 25, 2023https://github.com/python/cpython/pull/101013#issuecomment-1403419385
Please reload this pagehttps://github.com/python/cpython/pull/101013
@brandtbucherhttps://github.com/brandtbucher
Please reload this pagehttps://github.com/python/cpython/pull/101013
https://github.com/markshannon
markshannonhttps://github.com/markshannon
Jan 25, 2023 https://github.com/python/cpython/pull/101013#ref-pullrequest-1556472513
[3.11] GH-100762: Don't call gen.throw() in gen.close(), unless necessary #101316 https://github.com/python/cpython/pull/101316
https://github.com/markshannon
markshannonhttps://github.com/markshannon
September 26, 2023 12:55https://github.com/python/cpython/pull/101013#event-10474847167
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
needs backport to 3.11 https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22needs%20backport%20to%203.11%22
Feb 17, 2025https://github.com/python/cpython/pull/101013#event-16336488438
https://github.com/colesbury
colesburyhttps://github.com/colesbury
Dec 15, 2025 https://github.com/python/cpython/pull/101013#ref-issue-3732056553
generator.close() doesn't clear frame on newly created generators #142766 https://github.com/python/cpython/issues/142766
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F101013
https://github.com/gvanrossum
gvanrossum https://github.com/gvanrossum
https://github.com/python/cpython/pull/101013/files/dfd884ea94f771cb274258e555aecf556e0d5f33
https://github.com/brandtbucher
brandtbucher https://github.com/brandtbucher
https://github.com/python/cpython/pull/101013/files/044f2cf07c97386a0de8b10bf8419cf54dad13eb
https://github.com/iritkatriel
iritkatriel https://github.com/iritkatriel
https://github.com/markshannon
markshannon https://github.com/markshannon
Please reload this pagehttps://github.com/python/cpython/pull/101013
https://github.com/markshannon
https://github.com/brandtbucher
https://github.com/gvanrossum
https://github.com/miss-islington
https://github.com/iritkatriel
https://github.com/bedevere-bot
https://github.com/ZeroIntensity
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.