René's URL Explorer Experiment


Title: bpo-43224: Implement PEP 646 grammar changes by mrahtz · Pull Request #31018 · python/cpython · GitHub

Open Graph Title: bpo-43224: Implement PEP 646 grammar changes by mrahtz · Pull Request #31018 · python/cpython

X Title: bpo-43224: Implement PEP 646 grammar changes by mrahtz · Pull Request #31018 · python/cpython

Description: These are the parts of the old PR (#30398) relevant to only the grammar changes. To summarise, this adds support for: Starring within squared brackets, e.g. Tensor[*Ts], Tensor[T, *Ts] (where Ts is a TypeVarTuple and T is a TypeVar). But not within an actual slice - e.g. Tensor[0:*Ts] should not be valid. Starring the annotation given to *args, e.g. *args: *Ts. For 1, our intention is to call __iter__ on Ts and add the items from the resulting iterator to the tuple of arguments sent to Tensor.__cls_getitem__. For example, with Tensor[*Ts], if Ts.__iter__ returns an iterator yielding Ts.unpacked, Tensor.__cls_getitem__ would receive (Ts.unpacked,). With Tensor[T, *Ts], Tensor.__cls_getitem__ would receive (T, Ts.unpacked). For 2, our intention is to call __iter__ on Ts, get a single item from the iterator, verify that the iterator is exhausted, and set that item as the annotation for *args. I'm guessing the person I should ask for review on this is @pablogsal? https://bugs.python.org/issue43224

Open Graph Description: These are the parts of the old PR (#30398) relevant to only the grammar changes. To summarise, this adds support for: Starring within squared brackets, e.g. Tensor[*Ts], Tensor[T, *Ts] (where Ts i...

X Description: These are the parts of the old PR (#30398) relevant to only the grammar changes. To summarise, this adds support for: Starring within squared brackets, e.g. Tensor[*Ts], Tensor[T, *Ts] (where Ts i...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:163ad8ff-1ee3-b1d0-3d76-82c1b2c4680d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE7E4:2F0D9B:C7E69A:117B62C:696A37AF
html-safe-nonceb3285caa8498505f135847e86675c7647783c27b4784a5d6e96457460e0fd23a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFN0U0OjJGMEQ5QjpDN0U2OUE6MTE3QjYyQzo2OTZBMzdBRiIsInZpc2l0b3JfaWQiOiI3MTY0MTk2NzQ5MzM5OTMyNTkxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace706f6c85e1d65be26a6a91396cd4c7a9de7cd0e4d3eb1d3526f68cc8e9696d8
hovercard-subject-tagpull_request:835349496
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/31018/files
twitter:imagehttps://avatars.githubusercontent.com/u/4431336?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4431336?s=400&v=4
og:image:altThese are the parts of the old PR (#30398) relevant to only the grammar changes. To summarise, this adds support for: Starring within squared brackets, e.g. Tensor[*Ts], Tensor[T, *Ts] (where Ts i...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None321736bfdb3f591415ae895a0459bec204b26a76caf47ba5c980634cfacc4538
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
release7a9163cefd1ea4bd06f8eb7c082f43e4e53f626f
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/31018/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F31018%2Ffiles
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%2F31018%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/31018/files
Reloadhttps://github.com/python/cpython/pull/31018/files
Reloadhttps://github.com/python/cpython/pull/31018/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/31018/files
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/31018/files
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
JelleZijlstrahttps://github.com/JelleZijlstra
python:mainhttps://github.com/python/cpython/tree/main
mrahtz:pep646-grammarhttps://github.com/mrahtz/cpython/tree/pep646-grammar
Conversation 42 https://github.com/python/cpython/pull/31018
Commits 17 https://github.com/python/cpython/pull/31018/commits
Checks 0 https://github.com/python/cpython/pull/31018/checks
Files changed https://github.com/python/cpython/pull/31018/files
Please reload this pagehttps://github.com/python/cpython/pull/31018/files
bpo-43224: Implement PEP 646 grammar changes https://github.com/python/cpython/pull/31018/files#top
Show all changes 17 commits https://github.com/python/cpython/pull/31018/files
7ecb7ba bpo-43224: Implement PEP 646 grammar changes mrahtz Jan 30, 2022 https://github.com/python/cpython/pull/31018/commits/7ecb7ba6db087e96ef2be43901f43817adb9a8c0
c0531ec Add tests for del mrahtz Jan 30, 2022 https://github.com/python/cpython/pull/31018/commits/c0531ec6b3e82c971c763dee5965ccd2ab2aa668
479c175 Tweak news to better fit in with other PRs mrahtz Jan 30, 2022 https://github.com/python/cpython/pull/31018/commits/479c175be04206e2e0639d84b227bc977c68edd6
091ceeb Move error cases into test_syntax mrahtz Feb 13, 2022 https://github.com/python/cpython/pull/31018/commits/091ceebdb01c922b6fb67f8277a7bba56b997df1
f1c9c77 Add an extra failure test mrahtz Feb 14, 2022 https://github.com/python/cpython/pull/31018/commits/f1c9c77b3c5fcb675316f8d8653c842b0cdc7d2e
c8d2534 Add more tests combining slicing with starring mrahtz Mar 17, 2022 https://github.com/python/cpython/pull/31018/commits/c8d25343415153a320efadf434a3437379702422
5df1e97 Fix ast representation of slices combined with starring mrahtz Mar 17, 2022 https://github.com/python/cpython/pull/31018/commits/5df1e97bfdec08a9617bd24abb2cd5cfe1bb5ce6
677a326 Fix broken test in test_unparse mrahtz Mar 17, 2022 https://github.com/python/cpython/pull/31018/commits/677a326cc4cfa38cb02ccdaaa162970960317310
1543785 Add a check_src_roundtrip test for "a[1:2, *a]" mrahtz Mar 17, 2022 https://github.com/python/cpython/pull/31018/commits/1543785644e18065866d6d1646820c7871b3e9e2
e1ab6ea fix whitespace (make patchcheck) JelleZijlstra Mar 23, 2022 https://github.com/python/cpython/pull/31018/commits/e1ab6ea168c51d34b189a8ad7703c620dd2f0ee8
18e7fa7 Merge remote-tracking branch 'upstream/main' into pep646-grammar JelleZijlstra Mar 23, 2022 https://github.com/python/cpython/pull/31018/commits/18e7fa7f4139282a85b0df000c5576fdaaafe2df
72dd8b9 Add tests for AST changes mrahtz Mar 24, 2022 https://github.com/python/cpython/pull/31018/commits/72dd8b9445a7dc413ea03535026b60a67fbe6ff4
80bb5fa Fix C unpack mrahtz Mar 24, 2022 https://github.com/python/cpython/pull/31018/commits/80bb5facc2a311dc9b0e54aa58b59c39344e78b5
fbfd5b1 Fix typing.get_type_hints on variadic annotation mrahtz Mar 24, 2022 https://github.com/python/cpython/pull/31018/commits/fbfd5b142ee2bb4f136fabd0b38946b6b42fb02c
816098c Fix typo mrahtz Mar 24, 2022 https://github.com/python/cpython/pull/31018/commits/816098c82b8a3a9c372841e6f420e1377fd27a6a
8962d26 Remove debug print mrahtz Mar 25, 2022 https://github.com/python/cpython/pull/31018/commits/8962d26f3bde3d73ec2d985ab7c2d910f8d2d3c5
973e9cc Fix potential shadowing in ForwardRef mrahtz Mar 25, 2022 https://github.com/python/cpython/pull/31018/commits/973e9cca59abd57831561ae51284d6f9aaa921ac
Clear filters https://github.com/python/cpython/pull/31018/files
Please reload this pagehttps://github.com/python/cpython/pull/31018/files
Please reload this pagehttps://github.com/python/cpython/pull/31018/files
python.gram https://github.com/python/cpython/pull/31018/files#diff-2973ca53337859793077e9bdc1a1623063379f0fdfcb788836fd82ebb66b763b
ast.py https://github.com/python/cpython/pull/31018/files#diff-abeeed217a24ce3c21e15c2e32e2f0886cea69986c2641455c1eefc983c1f977
test_ast.py https://github.com/python/cpython/pull/31018/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
test_future.py https://github.com/python/cpython/pull/31018/files#diff-1c66f879de5afb6dc7a9febdd7e51b8676b7d4536ae70149fc6616bd1392c7e8
test_pep646_syntax.py https://github.com/python/cpython/pull/31018/files#diff-ee066cba0321e2389fca2161c9e90bf270585f64e82e00f78a1de8253557573c
test_syntax.py https://github.com/python/cpython/pull/31018/files#diff-985c9f5237c42a342864f5cbdb35dc56bc0017f44d5dfa561ecbef72e4a7ad4f
test_unparse.py https://github.com/python/cpython/pull/31018/files#diff-1393034a674edcc67802941e0e8cfa4966c9927ba9bde2cace103593140e3f89
typing.py https://github.com/python/cpython/pull/31018/files#diff-ddb987fca5f5df0c9a2f5521ed687919d70bb3d64eaeb8021f98833a2a716887
2022-01-20-16-48-09.bpo-43224.WDihrT.rst https://github.com/python/cpython/pull/31018/files#diff-6e6223d841af276d1ad47bcd52e4b9283e6b11b6c11e19d87c86bd53af1e6143
parser.c https://github.com/python/cpython/pull/31018/files#diff-6d39440cedc67d1ce7a0586bfb6ecb8483803448a9c93f3fae3ad0e2260e29f7
ast_unparse.c https://github.com/python/cpython/pull/31018/files#diff-d205bb48a85c9457b46a402a19e66c18860590b7ea8b55ae4da704444f433dba
compile.c https://github.com/python/cpython/pull/31018/files#diff-ebc983d9f91e5bcf73500e377ac65e85863c4f77fd5b6b6caf4fcdf7c0f0b057
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L301
Grammar/python.gramhttps://github.com/python/cpython/pull/31018/files#diff-2973ca53337859793077e9bdc1a1623063379f0fdfcb788836fd82ebb66b763b
View file https://github.com/mrahtz/cpython/blob/973e9cca59abd57831561ae51284d6f9aaa921ac/Grammar/python.gram
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/31018/{{ revealButtonHref }}
https://github.com/python/cpython/pull/31018/files#diff-2973ca53337859793077e9bdc1a1623063379f0fdfcb788836fd82ebb66b763b
https://github.com/python/cpython/pull/31018/files#diff-2973ca53337859793077e9bdc1a1623063379f0fdfcb788836fd82ebb66b763b
Please reload this pagehttps://github.com/python/cpython/pull/31018/files
https://github.com/python/cpython/pull/31018/files#diff-2973ca53337859793077e9bdc1a1623063379f0fdfcb788836fd82ebb66b763b
https://github.com/python/cpython/pull/31018/files#diff-2973ca53337859793077e9bdc1a1623063379f0fdfcb788836fd82ebb66b763b
Please reload this pagehttps://github.com/python/cpython/pull/31018/files
https://github.com/python/cpython/pull/31018/files#diff-2973ca53337859793077e9bdc1a1623063379f0fdfcb788836fd82ebb66b763b
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L201
Lib/ast.pyhttps://github.com/python/cpython/pull/31018/files#diff-abeeed217a24ce3c21e15c2e32e2f0886cea69986c2641455c1eefc983c1f977
View file https://github.com/mrahtz/cpython/blob/973e9cca59abd57831561ae51284d6f9aaa921ac/Lib/ast.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/31018/{{ revealButtonHref }}
https://github.com/python/cpython/pull/31018/files#diff-abeeed217a24ce3c21e15c2e32e2f0886cea69986c2641455c1eefc983c1f977
https://github.com/python/cpython/pull/31018/files#diff-abeeed217a24ce3c21e15c2e32e2f0886cea69986c2641455c1eefc983c1f977
Lib/test/test_ast.pyhttps://github.com/python/cpython/pull/31018/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
View file https://github.com/mrahtz/cpython/blob/973e9cca59abd57831561ae51284d6f9aaa921ac/Lib/test/test_ast.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/31018/{{ revealButtonHref }}
https://github.com/python/cpython/pull/31018/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/31018/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/31018/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/31018/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/31018/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/31018/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/31018/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
https://github.com/python/cpython/pull/31018/files#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937
Lib/test/test_future.pyhttps://github.com/python/cpython/pull/31018/files#diff-1c66f879de5afb6dc7a9febdd7e51b8676b7d4536ae70149fc6616bd1392c7e8
View file https://github.com/mrahtz/cpython/blob/973e9cca59abd57831561ae51284d6f9aaa921ac/Lib/test/test_future.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/31018/{{ revealButtonHref }}
https://github.com/python/cpython/pull/31018/files#diff-1c66f879de5afb6dc7a9febdd7e51b8676b7d4536ae70149fc6616bd1392c7e8
mrahtzhttps://github.com/mrahtz
Mar 24, 2022https://github.com/python/cpython/pull/31018/files#r834718999
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/31018/files
https://github.com/python/cpython/pull/31018/files#diff-1c66f879de5afb6dc7a9febdd7e51b8676b7d4536ae70149fc6616bd1392c7e8
https://github.com/python/cpython/pull/31018/files#diff-1c66f879de5afb6dc7a9febdd7e51b8676b7d4536ae70149fc6616bd1392c7e8
https://github.com/python/cpython/pull/31018/files#diff-1c66f879de5afb6dc7a9febdd7e51b8676b7d4536ae70149fc6616bd1392c7e8
https://github.com/python/cpython/pull/31018/files#diff-1c66f879de5afb6dc7a9febdd7e51b8676b7d4536ae70149fc6616bd1392c7e8
https://github.com/python/cpython/pull/31018/files#diff-1c66f879de5afb6dc7a9febdd7e51b8676b7d4536ae70149fc6616bd1392c7e8
Please reload this pagehttps://github.com/python/cpython/pull/31018/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.