René's URL Explorer Experiment


Title: bpo-33387: Simplify bytecodes for try-finally, try-except and with blocks. by markshannon · Pull Request #6641 · python/cpython · GitHub

Open Graph Title: bpo-33387: Simplify bytecodes for try-finally, try-except and with blocks. by markshannon · Pull Request #6641 · python/cpython

X Title: bpo-33387: Simplify bytecodes for try-finally, try-except and with blocks. by markshannon · Pull Request #6641 · python/cpython

Description: Quoting the bpo issue: The six complex bytecodes currently used for implementing 'with' and 'try' statements can be replaced with just two simpler bytecodes. The six bytecodes are WITH_CLEANUP_START, WITH_CLEANUP_FINISH, BEGIN_FINALLY, END_FINALLY, CALL_FINALLY and POP_FINALLY. They can be replaced with RERAISE and WITH_EXCEPT_START. See https://bugs.python.org/issue32949 for more details of the new bytecodes and how they are used in the 'with' statement. The try-finally statement can be implemented broadly as SETUP_FINALLY except try-body POP_BLOCK finally-body JUMP exit except: finally-body exit: The implementation of with statements is a bit more complex. The with statement with EXPR as VAR: BLOCK is implemented as: SETUP_WITH ex or POP_TOP LOAD_CONST (None, None, None) CALL_FUNCTION_EX 0 JUMP_FORWARD done ex: WITH_EXCEPT_START (calls EXPR.__exit__) POP_JUMP_IF_TRUE t: RERAISE t: POP_TOP * 3 (remove exception from stack) POP_EXCEPT POP_TOP done: https://bugs.python.org/issue33387

Open Graph Description: Quoting the bpo issue: The six complex bytecodes currently used for implementing 'with' and 'try' statements can be replaced with just two simpler bytecodes. The six bytecodes are ...

X Description: Quoting the bpo issue: The six complex bytecodes currently used for implementing 'with' and 'try' statements can be replaced with just two simpler bytecodes. The si...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:cba32410-3185-17b3-f770-8dc3715ee044
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8C0C:21D998:991D68:DEBADB:6A5741E8
html-safe-nonceac7e2ec05f2a5c2e3317c126d1d10b4f0f87808dca119dabfa5af91f093ec5d5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzBDOjIxRDk5ODo5OTFENjg6REVCQURCOjZBNTc0MUU4IiwidmlzaXRvcl9pZCI6IjU1MTU2MzM3ODExMTIyNTkwNDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7b137635051f62cb9054d39fa70dcd0f976d2a19900b3e18302f3d11a7f3d97f
hovercard-subject-tagpull_request:184847937
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/6641/files
twitter:imagehttps://avatars.githubusercontent.com/u/9448417?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/9448417?s=400&v=4
og:image:altQuoting the bpo issue: The six complex bytecodes currently used for implementing 'with' and 'try' statements can be replaced with just two simpler bytecodes. The six bytecodes are ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98
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
release2576d1f0198cf1588faf2edf27f1ed120903be10
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/6641/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F6641%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%2F6641%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/6641/files
Reloadhttps://github.com/python/cpython/pull/6641/files
Reloadhttps://github.com/python/cpython/pull/6641/files
Please reload this pagehttps://github.com/python/cpython/pull/6641/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/6641/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k 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
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
markshannonhttps://github.com/markshannon
python:masterhttps://github.com/python/cpython/tree/master
markshannon:python-better-try-finallyhttps://github.com/markshannon/cpython/tree/python-better-try-finally
Conversation 49 https://github.com/python/cpython/pull/6641
Commits 1 https://github.com/python/cpython/pull/6641/commits
Checks 0 https://github.com/python/cpython/pull/6641/checks
Files changed https://github.com/python/cpython/pull/6641/files
Please reload this pagehttps://github.com/python/cpython/pull/6641/files
bpo-33387: Simplify bytecodes for try-finally, try-except and with blocks. https://github.com/python/cpython/pull/6641/files#top
Show all changes 1 commit https://github.com/python/cpython/pull/6641/files
6364ee7 Produce cleaner bytecode for 'with' and 'async with' by generating se… markshannon Jan 6, 2018 https://github.com/python/cpython/pull/6641/commits/6364ee7e5dc1a9800fb4f82b00d8a266c0bde4b3
Clear filters https://github.com/python/cpython/pull/6641/files
Please reload this pagehttps://github.com/python/cpython/pull/6641/files
Please reload this pagehttps://github.com/python/cpython/pull/6641/files
dis.rst https://github.com/python/cpython/pull/6641/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
opcode.h https://github.com/python/cpython/pull/6641/files#diff-1cd1f0bb26c3fbaa279f83ee2bfe1d9072da7af07407111c79039c66034c57ed
_bootstrap_external.py https://github.com/python/cpython/pull/6641/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
opcode.py https://github.com/python/cpython/pull/6641/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
test_dis.py https://github.com/python/cpython/pull/6641/files#diff-fd7b118a01a9695dfa16eea9381d3c7b0652e1b7b55f51ff052a1f620d175642
test_sys_settrace.py https://github.com/python/cpython/pull/6641/files#diff-8b73bfc55514d8add8904c5f4d1d24b7b644ebfccba8d846085303577aa94dd6
2018-03-13-14-46-03.bpo-32949.v821M7.rst https://github.com/python/cpython/pull/6641/files#diff-62d39ae936bb03214315a1ed0d98cf9e5515f57fa1f2720846ceda7e545c0d89
frameobject.c https://github.com/python/cpython/pull/6641/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
ceval.c https://github.com/python/cpython/pull/6641/files#diff-c22186367cbe20233e843261998dc027ae5f1f8c0d2e778abfa454ae74cc59de
compile.c https://github.com/python/cpython/pull/6641/files#diff-ebc983d9f91e5bcf73500e377ac65e85863c4f77fd5b6b6caf4fcdf7c0f0b057
importlib.h https://github.com/python/cpython/pull/6641/files#diff-f22c3fe718474bf1830c047f516ef95818493a9a9fcf8f2d5b159b1b5b76ecd6
importlib_external.h https://github.com/python/cpython/pull/6641/files#diff-edaa85591e6f559d0fae8073b45dc3e9c8e251053d07623b2ce23392dfe97a7e
importlib_zipimport.h https://github.com/python/cpython/pull/6641/files#diff-885727a7f2320fa6a12abd49340cc1f516bc5e1bb4fdcb211da1e06e783adeef
opcode_targets.h https://github.com/python/cpython/pull/6641/files#diff-d3363a4083b77b9157d0bf07c2e87f3d3464a8b4360d5d23b07bbb23061f007a
peephole.c https://github.com/python/cpython/pull/6641/files#diff-3bc78aafc8aa0da74cdc1cbf79c5722d549b721c0b1c12f2943df3a531869846
Doc/library/dis.rsthttps://github.com/python/cpython/pull/6641/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
View file https://github.com/markshannon/cpython/blob/6364ee7e5dc1a9800fb4f82b00d8a266c0bde4b3/Doc/library/dis.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/6641/{{ revealButtonHref }}
https://github.com/python/cpython/pull/6641/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
https://github.com/python/cpython/pull/6641/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
https://github.com/python/cpython/pull/6641/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
https://github.com/python/cpython/pull/6641/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
https://github.com/python/cpython/pull/6641/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
https://github.com/python/cpython/pull/6641/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
Include/opcode.hhttps://github.com/python/cpython/pull/6641/files#diff-1cd1f0bb26c3fbaa279f83ee2bfe1d9072da7af07407111c79039c66034c57ed
View file https://github.com/markshannon/cpython/blob/6364ee7e5dc1a9800fb4f82b00d8a266c0bde4b3/Include/opcode.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/6641/files
Lib/importlib/_bootstrap_external.pyhttps://github.com/python/cpython/pull/6641/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
View file https://github.com/markshannon/cpython/blob/6364ee7e5dc1a9800fb4f82b00d8a266c0bde4b3/Lib/importlib/_bootstrap_external.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/6641/{{ revealButtonHref }}
https://github.com/python/cpython/pull/6641/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
https://github.com/python/cpython/pull/6641/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
https://github.com/python/cpython/pull/6641/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
Lib/opcode.pyhttps://github.com/python/cpython/pull/6641/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
View file https://github.com/markshannon/cpython/blob/6364ee7e5dc1a9800fb4f82b00d8a266c0bde4b3/Lib/opcode.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/6641/{{ revealButtonHref }}
https://github.com/python/cpython/pull/6641/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
https://github.com/python/cpython/pull/6641/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
https://github.com/python/cpython/pull/6641/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
https://github.com/python/cpython/pull/6641/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
https://github.com/python/cpython/pull/6641/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
Please reload this pagehttps://github.com/python/cpython/pull/6641/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.