Title: List generic arguments for `collections.abc` base classes in documentation · Issue #123583 · python/cpython · GitHub
Open Graph Title: List generic arguments for `collections.abc` base classes in documentation · Issue #123583 · python/cpython
X Title: List generic arguments for `collections.abc` base classes in documentation · Issue #123583 · python/cpython
Description: Documentation When #123544 lands, we'll have PEP585-related documentation spread even further than before. Deprecated aliases in typing correctly list the generic arguments, but are otherwise undocumented - all such entries boil down to ...
Open Graph Description: Documentation When #123544 lands, we'll have PEP585-related documentation spread even further than before. Deprecated aliases in typing correctly list the generic arguments, but are otherwise undoc...
X Description: Documentation When #123544 lands, we'll have PEP585-related documentation spread even further than before. Deprecated aliases in typing correctly list the generic arguments, but are otherwise u...
Opengraph URL: https://github.com/python/cpython/issues/123583
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"List generic arguments for `collections.abc` base classes in documentation","articleBody":"# Documentation\r\n\r\nWhen #123544 lands, we'll have PEP585-related documentation spread even further than before. Deprecated aliases in `typing` correctly list the generic arguments, but are otherwise undocumented - all such entries boil down to \"deprecated in favour of `collections.abc.X`\". \r\n\r\nSeveral relevant changes were discussed along #123523.\r\n\r\nThere's no direct way for a user to find generic parameters of `collections.abc.Generator` - they are listed for `typing.Generator` and in \"annotating generators and coroutines\" section in `typing` docs (the latter linked from `collections.abc.Generator`, though). \r\n\r\nI'm certain that generic arguments represent an essential part of class' \"signature\" - basic amount of information we need to see to use it somehow. \r\n\r\nHowever, `collections.abc` is not really a type-hinting module, hence providing those signatures there directly can add too much cognitive load.\r\n\r\nAs of now, my best suggestion is to introduce \"Type parameters\" section for each generic alias there, like this:\r\n\r\n```rst\r\n.. class:: Mapping\r\n MutableMapping\r\n\r\n ABCs for read-only and mutable :term:`mappings \u003cmapping\u003e`.\r\n\r\n Type arguments:\r\n\r\n * ``Mapping[KT, VT_co](Collection[KT])``\r\n * ``MutableMapping[KT, VT](Mapping[KT, VT])``\r\n```\r\n\r\ncc @AA-Turner and @AlexWaygood - we started this discussion in the PR above.","author":{"url":"https://github.com/sterliakov","@type":"Person","name":"sterliakov"},"datePublished":"2024-09-01T20:23:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/123583/cpython/issues/123583"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:89121b15-68b7-3427-b12d-521ff84be43d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 874A:F5661:2763047:355120E:696ADC36 |
| html-safe-nonce | dfa81dde80b9ebbb417ef58c001d1d3fb40921fef3336dbcf03f8f812a750baa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzRBOkY1NjYxOjI3NjMwNDc6MzU1MTIwRTo2OTZBREMzNiIsInZpc2l0b3JfaWQiOiI2NTc3ODMzODk0MTAxMDQ4Mzc0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e644535fef26de87d872385f29a31e67326dd6d79f0270c3409338d8955602cf |
| hovercard-subject-tag | issue:2499666886 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/123583/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d2cdbb961e9e791636f93140763c7b71b4e761939e692a07469ac45f30d78629/python/cpython/issues/123583 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d2cdbb961e9e791636f93140763c7b71b4e761939e692a07469ac45f30d78629/python/cpython/issues/123583 |
| og:image:alt | Documentation When #123544 lands, we'll have PEP585-related documentation spread even further than before. Deprecated aliases in typing correctly list the generic arguments, but are otherwise undoc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sterliakov |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 524a93f2c1f36522a3b4be4c110467ee4172245d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width