René's URL Explorer Experiment


Title: bpo-45680: Clarify documentation on ``GenericAlias`` objects by AlexWaygood · Pull Request #29335 · python/cpython · GitHub

Open Graph Title: bpo-45680: Clarify documentation on ``GenericAlias`` objects by AlexWaygood · Pull Request #29335 · python/cpython

X Title: bpo-45680: Clarify documentation on ``GenericAlias`` objects by AlexWaygood · Pull Request #29335 · python/cpython

Description: The documentation on GenericAlias objects implies at multiple points that only container classes can define __class_getitem__. This is misleading. This PR proposes a rewrite of the documentation to clarify that non-container classes can define __class_getitem__, and to clarify what it means when a non-container class is parameterized. The PR also proposes some changes to the list of standard library classes that define __class_getitem__. This PR proposes adding several classes to the list, to make it somewhat more complete. However, more importantly, it attempts to clarify that the list is not intended to be an exhaustive enumeration of every single standard-library class that defined __class_getitem__. See also: initial discussion of issues with this piece of documentation in #29308, and previous BPO issue 42280. https://bugs.python.org/issue45680

Open Graph Description: The documentation on GenericAlias objects implies at multiple points that only container classes can define __class_getitem__. This is misleading. This PR proposes a rewrite of the documentation to...

X Description: The documentation on GenericAlias objects implies at multiple points that only container classes can define __class_getitem__. This is misleading. This PR proposes a rewrite of the documentation to...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:22f92d87-6687-16fd-04b7-f1a6905f621e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE5A2:E8423:1A1B59F:22A866F:696AF046
html-safe-nonce84507514a5736536c4c17bc35a077e8674f888fadc8bf9e5867ed58c25ebdbc5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUEyOkU4NDIzOjFBMUI1OUY6MjJBODY2Rjo2OTZBRjA0NiIsInZpc2l0b3JfaWQiOiIyNDYxMTA2MjYzNDE2MzAzNjg2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacde9b1c96ea5de4c6634de3ea685cb5181a4e5d01bfc845dd6ec46dd96da958d4
hovercard-subject-tagpull_request:769793914
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/29335/files
twitter:imagehttps://avatars.githubusercontent.com/u/66076021?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/66076021?s=400&v=4
og:image:altThe documentation on GenericAlias objects implies at multiple points that only container classes can define __class_getitem__. This is misleading. This PR proposes a rewrite of the documentation to...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
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
disable-turbotrue
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/29335/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F29335%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%2F29335%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/29335/files
Reloadhttps://github.com/python/cpython/pull/29335/files
Reloadhttps://github.com/python/cpython/pull/29335/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/29335/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/29335/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
Fidget-Spinnerhttps://github.com/Fidget-Spinner
python:mainhttps://github.com/python/cpython/tree/main
AlexWaygood:generic-alias-docshttps://github.com/AlexWaygood/cpython/tree/generic-alias-docs
Conversation 69 https://github.com/python/cpython/pull/29335
Commits 30 https://github.com/python/cpython/pull/29335/commits
Checks 0 https://github.com/python/cpython/pull/29335/checks
Files changed https://github.com/python/cpython/pull/29335/files
Please reload this pagehttps://github.com/python/cpython/pull/29335/files
bpo-45680: Clarify documentation on GenericAlias objects https://github.com/python/cpython/pull/29335/files#top
Show all changes 30 commits https://github.com/python/cpython/pull/29335/files
a6fe738 bpo-45680: Clarify documentation on ``GenericAlias`` objects AlexWaygood Oct 30, 2021 https://github.com/python/cpython/pull/29335/commits/a6fe738d58a8a9087f3e172a55d600801317d859
cef0930 Correct typo AlexWaygood Oct 30, 2021 https://github.com/python/cpython/pull/29335/commits/cef09309ee2d61402c9d2dc01902647c496db390
614fce5 Add more `shelve` classes AlexWaygood Oct 31, 2021 https://github.com/python/cpython/pull/29335/commits/614fce5b61fb99a29cc620a0bddc3baaa57bd756
74269b8 Remove brackets AlexWaygood Nov 1, 2021 https://github.com/python/cpython/pull/29335/commits/74269b831aa37b1e5e9b6f4db5191a500f364d51
671579b Add link to container classes, remove use of the word 'they' AlexWaygood Nov 1, 2021 https://github.com/python/cpython/pull/29335/commits/671579bd716909be9017ffcfd93563c8b28826d0
d367338 Improve cross-references to data model docs AlexWaygood Nov 2, 2021 https://github.com/python/cpython/pull/29335/commits/d367338283c6152ffdf7ff7bf1903d0aa2c3c12e
d945e06 Move example to ``__class_getitem__`` docs in the data model AlexWaygood Nov 2, 2021 https://github.com/python/cpython/pull/29335/commits/d945e061e18173eaf1bf8dded736529ad402d5c7
629a29d revert line 4813 AlexWaygood Nov 2, 2021 https://github.com/python/cpython/pull/29335/commits/629a29d58ccaae0c7e63fc75e38ab4ae222afe01
5dd309c More instances where it is implied that only containers can be parame… AlexWaygood Nov 2, 2021 https://github.com/python/cpython/pull/29335/commits/5dd309c84951ade26dfb681990eaa210f66849d3
5dbccad Improve references in glossary and typing docs AlexWaygood Nov 2, 2021 https://github.com/python/cpython/pull/29335/commits/5dbccada0cdffc254e9abcb546e800d975ee685c
bc457dd Fix typing docs link to ``__class_getitem__`` method AlexWaygood Nov 2, 2021 https://github.com/python/cpython/pull/29335/commits/bc457dd532559bc546b650fe5e2bab4e1e2f4d07
d398971 Add note about ``typing.Generic`` AlexWaygood Nov 2, 2021 https://github.com/python/cpython/pull/29335/commits/d39897121918484c4cc838c29e95f6fd75d8594e
a195216 Merge branch 'generic-alias-docs' of https://github.com/AlexWaygood/c… AlexWaygood Nov 2, 2021 https://github.com/python/cpython/pull/29335/commits/a195216f1683f74d88414bae730242b8a9cf4c65
af257a6 Update glossary AlexWaygood Nov 18, 2021 https://github.com/python/cpython/pull/29335/commits/af257a624f2e40faec5c9ab49bf9684f79452500
eb7e7be Update typing AlexWaygood Nov 18, 2021 https://github.com/python/cpython/pull/29335/commits/eb7e7becfcc87ac09f77d8e3efdff27ef896599e
5c8fe0d update datamodel AlexWaygood Nov 18, 2021 https://github.com/python/cpython/pull/29335/commits/5c8fe0d88efec4914361a13404b8aaaded4832cd
010ca86 delete news AlexWaygood Nov 18, 2021 https://github.com/python/cpython/pull/29335/commits/010ca866525733e4cb45274048bed4bc22dae9dd
682cd6d Merge remote-tracking branch 'origin/main' into generic-alias-docs AlexWaygood Nov 18, 2021 https://github.com/python/cpython/pull/29335/commits/682cd6d60f9ddd4d3ffe9587d459179e09a41fe0
92e0463 A few tweaks AlexWaygood Nov 19, 2021 https://github.com/python/cpython/pull/29335/commits/92e046394cfe6c475048d0c62a85143d73392b28
dd3369e Add full stop. AlexWaygood Nov 19, 2021 https://github.com/python/cpython/pull/29335/commits/dd3369ec6a0bc229eecda7b58b0c2bb378d2f2c6
6e2d8f5 Remove redundant clause. AlexWaygood Nov 19, 2021 https://github.com/python/cpython/pull/29335/commits/6e2d8f58ef66d559236f47b10179ba383c0c2cb3
43f9429 Update Doc/library/stdtypes.rst AlexWaygood Nov 19, 2021 https://github.com/python/cpython/pull/29335/commits/43f9429f88a238281989810d2958449f4de9f53d
ba2af17 Reduce diff AlexWaygood Nov 29, 2021 https://github.com/python/cpython/pull/29335/commits/ba2af17d4fcdba4b38cba33142e0867e60ccb3a7
2776b8d Trailing whitespace AlexWaygood Nov 29, 2021 https://github.com/python/cpython/pull/29335/commits/2776b8d63b23e34db70bec2a86bf796b84c43441
f2efd8b Update Doc/library/stdtypes.rst AlexWaygood Dec 4, 2021 https://github.com/python/cpython/pull/29335/commits/f2efd8b35b4524ac45cbb124dbde75e37c35af82
ec8a509 Fix CI AlexWaygood Dec 4, 2021 https://github.com/python/cpython/pull/29335/commits/ec8a509824f7fddfad5b895a9d01f3b2bf42aff0
8fad702 Improve markup readability AlexWaygood Dec 5, 2021 https://github.com/python/cpython/pull/29335/commits/8fad702aac2c9335e7e5bad4cb5e704551940292
e5a57e8 Steer clear of the word "subtype" AlexWaygood Dec 5, 2021 https://github.com/python/cpython/pull/29335/commits/e5a57e8fa37e5fbbc7d3ae5dee4bed9a399ef0d0
ae21ffe Tweak AlexWaygood Dec 5, 2021 https://github.com/python/cpython/pull/29335/commits/ae21ffe002e672e89edf32d40b85317fc5c2f0a5
3944e8c Apply formatting suggestions from code review Fidget-Spinner Jan 19, 2022 https://github.com/python/cpython/pull/29335/commits/3944e8caf8034da4828e9d49bfc2836477cf9d8c
Clear filters https://github.com/python/cpython/pull/29335/files
Please reload this pagehttps://github.com/python/cpython/pull/29335/files
Please reload this pagehttps://github.com/python/cpython/pull/29335/files
Doc/library/stdtypes.rsthttps://github.com/python/cpython/pull/29335/files#diff-08a31a70dd1f6d97aa8dacdce77db4de04c700d9949be1af611a595186aad5b3
View file https://github.com/AlexWaygood/cpython/blob/3944e8caf8034da4828e9d49bfc2836477cf9d8c/Doc/library/stdtypes.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/29335/{{ revealButtonHref }}
https://github.com/python/cpython/pull/29335/files#diff-08a31a70dd1f6d97aa8dacdce77db4de04c700d9949be1af611a595186aad5b3
AlexWaygoodhttps://github.com/AlexWaygood
Oct 30, 2021https://github.com/python/cpython/pull/29335/files#r739707123
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/29335/files
Please reload this pagehttps://github.com/python/cpython/pull/29335/files
AlexWaygoodhttps://github.com/AlexWaygood
Nov 2, 2021https://github.com/python/cpython/pull/29335/files#r740964155
Please reload this pagehttps://github.com/python/cpython/pull/29335/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
@Fidget-Spinnerhttps://github.com/Fidget-Spinner
#29389https://github.com/python/cpython/pull/29389
Please reload this pagehttps://github.com/python/cpython/pull/29335/files
Please reload this pagehttps://github.com/python/cpython/pull/29335/files
Please reload this pagehttps://github.com/python/cpython/pull/29335/files
https://github.com/python/cpython/pull/29335/files#diff-08a31a70dd1f6d97aa8dacdce77db4de04c700d9949be1af611a595186aad5b3
https://github.com/python/cpython/pull/29335/files#diff-08a31a70dd1f6d97aa8dacdce77db4de04c700d9949be1af611a595186aad5b3
https://github.com/python/cpython/pull/29335/files#diff-08a31a70dd1f6d97aa8dacdce77db4de04c700d9949be1af611a595186aad5b3
AlexWaygoodhttps://github.com/AlexWaygood
Nov 1, 2021https://github.com/python/cpython/pull/29335/files#r740472142
Please reload this pagehttps://github.com/python/cpython/pull/29335/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
@ambvhttps://github.com/ambv
Please reload this pagehttps://github.com/python/cpython/pull/29335/files
https://github.com/python/cpython/pull/29335/files#diff-08a31a70dd1f6d97aa8dacdce77db4de04c700d9949be1af611a595186aad5b3
https://github.com/python/cpython/pull/29335/files#diff-08a31a70dd1f6d97aa8dacdce77db4de04c700d9949be1af611a595186aad5b3
https://github.com/python/cpython/pull/29335/files#diff-08a31a70dd1f6d97aa8dacdce77db4de04c700d9949be1af611a595186aad5b3
https://github.com/python/cpython/pull/29335/files#diff-08a31a70dd1f6d97aa8dacdce77db4de04c700d9949be1af611a595186aad5b3
Please reload this pagehttps://github.com/python/cpython/pull/29335/files
https://github.com/python/cpython/pull/29335/files#diff-08a31a70dd1f6d97aa8dacdce77db4de04c700d9949be1af611a595186aad5b3
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.