René's URL Explorer Experiment


Title: Introducing try..catch · Issue #3 · python/exceptiongroups · GitHub

Open Graph Title: Introducing try..catch · Issue #3 · python/exceptiongroups

X Title: Introducing try..catch · Issue #3 · python/exceptiongroups

Description: If we find we really need new syntax to flag that people have thought about the consequences of multi-exceptions, we could switch the existing try..except syntax to try..catch. It seems most other languages use the latter keyword anyway....

Open Graph Description: If we find we really need new syntax to flag that people have thought about the consequences of multi-exceptions, we could switch the existing try..except syntax to try..catch. It seems most other ...

X Description: If we find we really need new syntax to flag that people have thought about the consequences of multi-exceptions, we could switch the existing try..except syntax to try..catch. It seems most other ...

Opengraph URL: https://github.com/python/exceptiongroups/issues/3

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Introducing try..catch","articleBody":"*If* we find we really need new syntax to flag that people have thought about the consequences of multi-exceptions, we could switch the existing `try..except` syntax to `try..catch`. It seems most other languages use the latter keyword anyway.\r\n\r\nSyntax\r\n-------\r\n\r\nThe syntax would just replace `except` with `catch`, leaving everything else the same.\r\n\r\nWe have the option however of disallowing `catch:` (i.e. with no exception, the catch-all block) -- forcing people (and automatic translators) to write `catch BaseException:`.\r\n\r\nNote that `catch` would have to be a soft keyword (supported by the new PEG parser, see PEP 617), since there are plenty of other uses of `catch` in existing code that we don't want to break.\r\n\r\nTransition\r\n----------\r\n\r\nThe transition plan would be that `try..exept` will eventually be removed from the language. There would be three stages:\r\n\r\n1. `try..catch` and `try..except` can both be used.\r\n2. `try..except` works but gives a deprecation warning.\r\n3. `try..except` stops working.\r\n\r\nPossibly stage 2 can be split and `try..except` inside `async` functions can be deprecated sooner than in other contexts.\r\n\r\nDuring stages 1 and 2, each `try` statement must use either `catch` or `except` -- you cannot have both `catch` and `except` blocks in the same statement. (But you can have them in the same file.)\r\n\r\nSemantics\r\n-----------\r\n\r\nWhen the raised exception is not a multi-exception the semantics of `try..catch` is the same as for `try..except`.\r\n\r\nWhen the raised exception is a multi-error the semantics change.\r\n\r\nBasically when a multi-error contains different exception types it is possible that more than one `catch` block runs. E.g.\r\n```\r\ntry:\r\n    raise MultiError([ValueError(), ZeroDivisionError(), RuntimeError()])  # or whatever\r\ncatch ValueError:\r\n    print(\"VE\")\r\ncatch RuntimeError:\r\n    print(\"RE\")\r\n```\r\nwould print \"VE\" and \"RE\" and then raise (bubble up) `RuntimeError()` (or `MultiError([RuntimeError()]`).\r\n\r\nIf there's an `else` block it only gets run if no exceptions were raised in the first place.\r\n\r\nIf there's a `finally` block it gets run after all `catch` blocks (if any) have run, before bubbling up the unhandled exceptions (if any).\r\n\r\nThe order in which the exceptions in the multi-error are handled is just the order in which the `MultiError` object regurgitates them.\r\n\r\nMultiple exceptions of the same type\r\n-------------------------------------\r\n\r\nThis is an open issue.\r\n\r\nWhat if the try block raises `MultiError([ValueError(\"A\"), ValueError(\"B\")])`? We could define different semantics.\r\n\r\nNote that there would also be a question about two different exception classes that derive from the same base class, where the `catch` class specifies that base (or ultimately `catch BaseException`). So we cannot rely on `MultiError` to split exceptions based on class before we start matching exceptions to catch blocks.\r\n\r\n**TO BE CONTINUED IN A LATER COMMENT** (I deleted some meta-comments related to this.)","author":{"url":"https://github.com/gvanrossum","@type":"Person","name":"gvanrossum"},"datePublished":"2020-10-22T18:22:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":43},"url":"https://github.com/3/exceptiongroups/issues/3"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:02f4a73f-4cb6-9318-39a0-677b085560ed
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB28C:10CAF0:BC6291:FC3C26:69699713
html-safe-nonce7fba5b44fcb26dd917e087b9cfbec011bc3fdc50d3c7016a7087ff2d89f7222d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjhDOjEwQ0FGMDpCQzYyOTE6RkMzQzI2OjY5Njk5NzEzIiwidmlzaXRvcl9pZCI6IjQ3MzI4ODU1OTA2NTI1ODk4NDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca274baa625073c3d6db6651bb09835bc44ad9b3cb387c8334e079f18c5f2cada
hovercard-subject-tagissue:727619817
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/exceptiongroups/3/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a99e383ee4315029a02055d68c1d0393c5f2b0a82bc6ab2ce71044e0e62595d3/python/exceptiongroups/issues/3
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a99e383ee4315029a02055d68c1d0393c5f2b0a82bc6ab2ce71044e0e62595d3/python/exceptiongroups/issues/3
og:image:altIf we find we really need new syntax to flag that people have thought about the consequences of multi-exceptions, we could switch the existing try..except syntax to try..catch. It seems most other ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamegvanrossum
hostnamegithub.com
expected-hostnamegithub.com
None3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751
turbo-cache-controlno-preview
go-importgithub.com/python/exceptiongroups git https://github.com/python/exceptiongroups.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id228462148
octolytics-dimension-repository_nwopython/exceptiongroups
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id228462148
octolytics-dimension-repository_network_root_nwopython/exceptiongroups
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
releaseaf80af7cc9e3de9c336f18b208a600950a3c187c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/exceptiongroups/issues/3#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fexceptiongroups%2Fissues%2F3
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%2Fexceptiongroups%2Fissues%2F3
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%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fexceptiongroups
Reloadhttps://github.com/python/exceptiongroups/issues/3
Reloadhttps://github.com/python/exceptiongroups/issues/3
Reloadhttps://github.com/python/exceptiongroups/issues/3
python https://github.com/python
exceptiongroupshttps://github.com/python/exceptiongroups
Notifications https://github.com/login?return_to=%2Fpython%2Fexceptiongroups
Fork 2 https://github.com/login?return_to=%2Fpython%2Fexceptiongroups
Star 21 https://github.com/login?return_to=%2Fpython%2Fexceptiongroups
Code https://github.com/python/exceptiongroups
Issues 2 https://github.com/python/exceptiongroups/issues
Pull requests 0 https://github.com/python/exceptiongroups/pulls
Actions https://github.com/python/exceptiongroups/actions
Projects 0 https://github.com/python/exceptiongroups/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/exceptiongroups/security
Please reload this pagehttps://github.com/python/exceptiongroups/issues/3
Insights https://github.com/python/exceptiongroups/pulse
Code https://github.com/python/exceptiongroups
Issues https://github.com/python/exceptiongroups/issues
Pull requests https://github.com/python/exceptiongroups/pulls
Actions https://github.com/python/exceptiongroups/actions
Projects https://github.com/python/exceptiongroups/projects
Security https://github.com/python/exceptiongroups/security
Insights https://github.com/python/exceptiongroups/pulse
Introducing try..catchhttps://github.com/python/exceptiongroups/issues/3#top
https://github.com/gvanrossum
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Oct 22, 2020https://github.com/python/exceptiongroups/issues/3#issue-727619817
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.